Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
concrexit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
thalia
concrexit
Commits
f86ec239
Commit
f86ec239
authored
8 years ago
by
Luuk Scholten
Browse files
Options
Downloads
Plain Diff
Merge branch 'release/1.1.0' into 'master'
Backmerge of
1.1.1 See merge request
!285
parents
1f06e650
ecc78651
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!285
Backmerge of :ambulance: 1.1.1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
website/thaliapp/views.py
+11
-3
11 additions, 3 deletions
website/thaliapp/views.py
website/thaliawebsite/views.py
+5
-1
5 additions, 1 deletion
website/thaliawebsite/views.py
with
16 additions
and
4 deletions
website/thaliapp/views.py
+
11
−
3
View file @
f86ec239
...
...
@@ -6,6 +6,8 @@ from django.views.decorators.http import require_POST
from
django.contrib.auth
import
authenticate
from
django.contrib.staticfiles.finders
import
find
as
find_static_file
from
django.core.cache
import
cache
from
django.views.decorators.debug
import
(
sensitive_variables
,
sensitive_post_parameters
)
from
thaliapp.models
import
Token
from
hashlib
import
sha256
from
base64
import
b64encode
...
...
@@ -29,6 +31,8 @@ def get_photo(user):
return
photo
@sensitive_post_parameters
()
@sensitive_variables
(
'
user
'
,
'
password
'
,
'
token
'
)
@csrf_exempt
@require_POST
def
login
(
request
):
...
...
@@ -52,9 +56,11 @@ def login(request):
})
return
JsonResponse
({
'
status
'
:
'
error
'
,
'
msg
'
:
'
Authentication Failed
'
},
status
_code
=
403
)
status
=
403
)
@sensitive_post_parameters
()
@sensitive_variables
(
'
username
'
,
'
token
'
)
@csrf_exempt
@require_POST
def
app
(
request
):
...
...
@@ -69,7 +75,7 @@ def app(request):
if
user
is
None
:
return
JsonResponse
({
'
status
'
:
'
error
'
,
'
msg
'
:
'
Authentication Failed
'
},
status
_code
=
403
)
status
=
403
)
today
=
datetime
.
date
.
today
()
eightteen_years_ago
=
today
.
replace
(
year
=
today
.
year
-
18
)
over18
=
str
(
user
.
member
.
birthday
<=
eightteen_years_ago
)
...
...
@@ -91,6 +97,8 @@ def app(request):
})
@sensitive_post_parameters
()
@sensitive_variables
(
'
username
'
,
'
token
'
)
@csrf_exempt
@require_POST
def
scan
(
request
):
...
...
@@ -104,7 +112,7 @@ def scan(request):
if
user
is
None
:
return
JsonResponse
({
'
status
'
:
'
error
'
,
'
msg
'
:
'
Authentication Failed
'
},
status
_code
=
403
)
status
=
403
)
cache
.
set
(
''
.
join
([
qrtoken
]),
user
,
300
)
return
JsonResponse
({
'
status
'
:
'
ok
'
})
...
...
This diff is collapsed.
Click to expand it.
website/thaliawebsite/views.py
+
5
−
1
View file @
f86ec239
...
...
@@ -10,6 +10,8 @@ from django.shortcuts import render
from
django.utils
import
timezone
from
django.views.decorators.csrf
import
csrf_exempt
from
django.views.decorators.http
import
require_POST
from
django.views.decorators.debug
import
(
sensitive_variables
,
sensitive_post_parameters
)
from
sendfile
import
sendfile
...
...
@@ -21,6 +23,8 @@ def styleguide(request):
return
render
(
request
,
'
singlepages/styleguide.html
'
)
@sensitive_variables
()
@sensitive_post_parameters
()
@require_POST
@csrf_exempt
def
wiki_login
(
request
):
...
...
@@ -54,7 +58,7 @@ def wiki_login(request):
'
committees
'
:
memberships
})
return
JsonResponse
({
'
status
'
:
'
error
'
,
'
msg
'
:
'
Authentication Failed
'
},
status
_code
=
403
)
status
=
403
)
@login_required
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment