Skip to content
Snippets Groups Projects
Commit 19cdc909 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

allow user to read privacy notice before accepting it

parent e4f195ec
No related branches found
No related tags found
1 merge request!276Resolve "privacy notice and usage terms"
......@@ -22,7 +22,10 @@ class PrivacyNoticeMiddleware(MiddlewareMixin):
worker = Worker.get_by_user(request.user)
if worker is None:
return None
if study.study_privacy_notice and study.acceptance_of_study_privacy_notice_required and not worker.privacy_notice_accepted:
if study.study_privacy_notice \
and study.acceptance_of_study_privacy_notice_required \
and not worker.privacy_notice_accepted\
and study.study_privacy_notice.document.url != request.path:
messages.add_message(request, messages.WARNING, "You can't use the system until you accept the privacy notice.")
#return reverse_lazy('web.views.accept_privacy_notice', kwargs={'pk': study.study_privacy_notice})
return redirect(reverse('web.views.accept_privacy_notice', kwargs={'pk': study.study_privacy_notice.id}))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment