Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
e54e541a
Commit
e54e541a
authored
Jan 29, 2021
by
Fabien MAREUIL
Browse files
maintenance page
parent
5312f8d7
Pipeline
#46844
failed with stages
in 7 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippisite/views.py
0 → 100644
View file @
e54e541a
# -*- 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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment