From 117f4e8dc29af930cebcd657fc8bf29403d8ae66 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Fri, 24 Aug 2018 09:33:39 -0400 Subject: [PATCH] Handle case where user or profile form is invalid, send the user back to them to fix any errors --- get_together/views/new_user.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/get_together/views/new_user.py b/get_together/views/new_user.py index cf66c6b..c8642c9 100644 --- a/get_together/views/new_user.py +++ b/get_together/views/new_user.py @@ -47,6 +47,14 @@ def setup_1_confirm_profile(request): # Call the view to trigger sending a confirmation email, but ignore it's response user_send_confirmation_email(request) return redirect('setup-2-pick-categories') + else: + context = { + 'user': user, + 'profile': profile, + 'user_form': user_form, + 'profile_form': profile_form, + } + return render(request, 'get_together/new_user/setup_1_confirm_profile.html', context) else: return redirect('home')