Handle case where user or profile form is invalid, send the user back to them to fix any errors

This commit is contained in:
Michael Hall 2018-08-24 09:33:39 -04:00
parent 30083d573c
commit 117f4e8dc2

View file

@ -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')