agree create 3

This commit is contained in:
H.T. Kruitbosch 2018-05-04 16:53:06 +02:00
parent 36dcc0445b
commit c82c23aac4

View File

@ -33,7 +33,6 @@ def gdpr_ask_agreement(request):
return render(request, 'rugwebsite/gdpr.html', {'show_agree_button': False, 'shownav': True}) return render(request, 'rugwebsite/gdpr.html', {'show_agree_button': False, 'shownav': True})
@login_required
def gdpr_create_agree(request): def gdpr_create_agree(request):
if request.method == 'POST': if request.method == 'POST':
form = GDPRAgreeCreate(request.POST) form = GDPRAgreeCreate(request.POST)
@ -49,6 +48,7 @@ def gdpr_create_agree(request):
return render(request, 'rugwebsite/gdpr_agree_success.html', {'shownav': True}) return render(request, 'rugwebsite/gdpr_agree_success.html', {'shownav': True})
else: else:
assert request.user.is_authenticated(), "User should be authenticated."
data = json.dumps([request.user.username, request.user.first_name, request.user.last_name, request.user.email]) data = json.dumps([request.user.username, request.user.first_name, request.user.last_name, request.user.email])
sha256 = hashlib.sha256() sha256 = hashlib.sha256()
request.session['samlPersoonsgegevensHash'] = sha256.hexdigest() request.session['samlPersoonsgegevensHash'] = sha256.hexdigest()