Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Already redirect when visiting the registration page, not only on POST

Roland Geider978ecd36937c
diff --git a/wger/manager/views/user.py b/wger/manager/views/user.py
index 8ff2ebebf..8b902690f 100644
--- a/wger/manager/views/user.py
+++ b/wger/manager/views/user.py
@@ -80,12 +80,11 @@ def registration(request):
is_app = check_request_amazon(request) or check_request_android(request)
FormClass = RegistrationFormNoCaptcha if is_app else RegistrationForm
- if request.method == 'POST':
-
- # Redirect regular users, in case they reached the registration page
- if request.user.is_authenticated() and not request.user.userprofile.is_temporary:
- return HttpResponseRedirect(reverse('dashboard'))
+ # Redirect regular users, in case they reached the registration page
+ if request.user.is_authenticated() and not request.user.userprofile.is_temporary:
+ return HttpResponseRedirect(reverse('dashboard'))
+ if request.method == 'POST':
form = FormClass(data=request.POST)
# If the data is valid, log in and redirect