Commit e54e541a authored by Fabien  MAREUIL's avatar Fabien MAREUIL
Browse files

maintenance page

parent 5312f8d7
Pipeline #46844 failed with stages
in 7 minutes and 58 seconds
# -*- coding: utf-8 -*-
from django.http import HttpResponseRedirect
from maintenance_mode.core import set_maintenance_mode
def maintenance_mode_off(request):
"""
Deactivate maintenance-mode and redirect to site root.
Only superusers are allowed to use this view.
"""
if request.user.is_superuser:
set_maintenance_mode(False)
return HttpResponseRedirect('/admin')
def maintenance_mode_on(request):
"""
Activate maintenance-mode and redirect to site root.
Only superusers are allowed to use this view.
"""
if request.user.is_superuser:
set_maintenance_mode(True)
return HttpResponseRedirect('/admin')
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment