confirmation/views: Restructure code for clarity.

This commit is contained in:
Rishi Gupta 2017-07-07 02:29:20 -07:00 committed by Tim Abbott
parent cf6aefb37a
commit a44d8f7b01
1 changed files with 6 additions and 10 deletions

View File

@ -20,14 +20,10 @@ from typing import Any, Dict
def confirm(request, confirmation_key):
# type: (HttpRequest, str) -> HttpResponse
obj = Confirmation.objects.confirm(confirmation_key)
ctx = {'confirmed': False} # type: Dict[str, Any]
templates = [
'confirmation/confirm.html',
]
if obj:
ctx = {
return render(request, 'confirmation/confirm_preregistrationuser.html',
context={
'key': confirmation_key,
'full_name': request.GET.get("full_name", None),
}
templates = ['confirmation/confirm_preregistrationuser.html']
return render(request, templates, context=ctx)
'full_name': request.GET.get("full_name", None)})
else:
return render(request, 'confirmation/confirm.html', context = {'confirmed': False})