Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mediatek
Base de données Mediatek
Commits
75424a61
Commit
75424a61
authored
Jul 28, 2017
by
Med
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nettoie la conf settings
parent
1b2023fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
med/settings.py
med/settings.py
+0
-1
users/decorators.py
users/decorators.py
+2
-1
No files found.
med/settings.py
View file @
75424a61
...
...
@@ -150,4 +150,3 @@ PAGINATION_NUMBER = 25
PAGINATION_LARGE_NUMBER
=
8
GENERIC_IPSET_COMMAND
=
"/sbin/ipset -q "
users/decorators.py
View file @
75424a61
...
...
@@ -26,6 +26,7 @@
from
django.core.exceptions
import
PermissionDenied
from
django.shortcuts
import
redirect
from
med.settings
import
AUTHORIZED_IP_RANGE
,
AUTHORIZED_IP6_RANGE
import
ipaddress
...
...
@@ -34,7 +35,7 @@ def user_is_in_campus(function):
if
not
request
.
user
.
is_authenticated
:
remote_ip
=
get_ip
(
request
)
if
not
ipaddress
.
ip_address
(
remote_ip
)
in
ipaddress
.
ip_network
(
AUTHORIZED_IP_RANGE
)
and
not
ipaddress
.
ip_address
(
remote_ip
)
in
ipaddress
.
ip_network
(
AUTHORIZED_IP6_RANGE
):
r
aise
PermissionDenied
r
eturn
redirect
(
"/"
)
return
function
(
request
,
*
args
,
**
kwargs
)
wrap
.
__doc__
=
function
.
__doc__
wrap
.
__name__
=
function
.
__name__
...
...
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