Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
a40c9d20
Commit
a40c9d20
authored
Feb 18, 2020
by
Guilhem Saurel
Browse files
redirect to login page
parent
90f2f220
Pipeline
#8426
passed with stage
in 1 minute and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dashboard/middleware.py
View file @
a40c9d20
from
ipaddress
import
ip_address
,
ip_network
from
django.conf
import
settings
from
django.http
import
HttpRequest
,
HttpResponse
,
HttpResponseForbidden
from
django.http
import
HttpRequest
,
HttpResponse
,
HttpResponseRedirect
from
django.shortcuts
import
reverse
from
rest_framework
import
permissions
...
...
@@ -27,4 +28,4 @@ class LAASPermsMiddleware:
if
allowed
:
return
self
.
get_response
(
request
)
return
HttpResponse
Forbidden
(
)
return
HttpResponse
Redirect
(
reverse
(
'login'
)
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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