Mercurial > public > sg101
diff accounts/views.py @ 1114:6dd1f0065859
Convert registration views to V3 design.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 12 Jul 2016 20:44:20 -0500 |
parents | be233ba7ca31 |
children | d613d25a021e |
line wrap: on
line diff
--- a/accounts/views.py Tue Jul 12 19:38:54 2016 -0500 +++ b/accounts/views.py Tue Jul 12 20:44:20 2016 -0500 @@ -34,7 +34,10 @@ else: form = RegisterForm() - return render(request, 'accounts/register.html', {'form': form}) + return render(request, 'accounts/register.html', { + 'form': form, + 'V3_DESIGN': True, + }) ####################################################################### @@ -43,7 +46,9 @@ if request.user.is_authenticated(): return redirect(settings.LOGIN_REDIRECT_URL) - return render(request, 'accounts/register1.html') + return render(request, 'accounts/register1.html', { + 'V3_DESIGN': True, + }) ####################################################################### @@ -63,7 +68,10 @@ else: form = RegisterCodeForm() - return render(request, 'accounts/register2.html', {'form': form}) + return render(request, 'accounts/register2.html', { + 'form': form, + 'V3_DESIGN': True, + }) ####################################################################### @@ -81,7 +89,9 @@ if request.user.is_authenticated(): return redirect(settings.LOGIN_REDIRECT_URL) - return render(request, 'accounts/register_thanks.html') + return render(request, 'accounts/register_thanks.html', { + 'V3_DESIGN': True, + }) ####################################################################### @@ -97,22 +107,26 @@ try: pending_user = PendingUser.objects.get(username = username) except PendingUser.DoesNotExist: - logger.error('Accounts register_confirm [%s]: user does not exist: %s', ip, username) - return render(request, - 'accounts/register_failure.html', - {'username': username}) + logger.error('Accounts register_confirm [%s]: user does not exist: %s', + ip, username) + return render(request, 'accounts/register_failure.html', { + 'username': username, + 'V3_DESIGN': True, + }) if pending_user.key != key: logger.error('Accounts register_confirm [%s]: key error: %s', ip, username) - return render(request, - 'accounts/register_failure.html', - {'username': username}) + return render(request, 'accounts/register_failure.html', { + 'username': username, + 'V3_DESIGN': True, + }) create_new_user(pending_user, ip) - return render(request, - 'accounts/register_success.html', - {'username': username}) + return render(request, 'accounts/register_success.html', { + 'username': username, + 'V3_DESIGN': True, + }) #######################################################################