Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Commits
a60e315c
Commit
a60e315c
authored
4 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
allow to logout
parent
19cdc909
No related branches found
No related tags found
1 merge request
!276
Resolve "privacy notice and usage terms"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/middleware.py
+6
-2
6 additions, 2 deletions
smash/web/middleware.py
with
6 additions
and
2 deletions
smash/web/middleware.py
+
6
−
2
View file @
a60e315c
from
django.contrib.auth.views
import
logout
from
web.models.constants
import
GLOBAL_STUDY_ID
from
web.models.constants
import
GLOBAL_STUDY_ID
from
web.models
import
Worker
,
Study
from
web.models
import
Worker
,
Study
from
django.contrib
import
messages
from
django.contrib
import
messages
...
@@ -16,8 +18,10 @@ class PrivacyNoticeMiddleware(MiddlewareMixin):
...
@@ -16,8 +18,10 @@ class PrivacyNoticeMiddleware(MiddlewareMixin):
# the view (and later middleware) are called.
# the view (and later middleware) are called.
#response = self.get_response(request)
#response = self.get_response(request)
if
request
.
user
.
is_authenticated
\
if
request
.
user
.
is_authenticated
and
not
view_func
==
privacy_notice_accept
and
not
request
.
user
.
is_superuser
:
and
not
view_func
==
privacy_notice_accept
\
and
not
request
.
user
.
is_superuser
\
and
not
view_func
==
logout
:
study
=
Study
.
objects
.
filter
(
id
=
GLOBAL_STUDY_ID
)[
0
]
study
=
Study
.
objects
.
filter
(
id
=
GLOBAL_STUDY_ID
)[
0
]
worker
=
Worker
.
get_by_user
(
request
.
user
)
worker
=
Worker
.
get_by_user
(
request
.
user
)
if
worker
is
None
:
if
worker
is
None
:
...
...
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