Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Remove the autofocus attribute from the username field

Roland Geider3c0a788b78ed
diff --git a/wger/software/views.py b/wger/software/views.py
index f4f60f276..5127630d3 100644
--- a/wger/software/views.py
+++ b/wger/software/views.py
@@ -56,7 +56,10 @@ def features(request):
FormClass = RegistrationForm if settings.WGER_SETTINGS['USE_RECAPTCHA'] \
else RegistrationFormNoCaptcha
- context['form'] = FormClass()
+ form = FormClass()
+ form.fields['username'].widget.attrs.pop("autofocus", None)
+
+ context['form'] = form
context['allow_registration'] = settings.WGER_SETTINGS['ALLOW_REGISTRATION']
context['allow_guest_users'] = settings.WGER_SETTINGS['ALLOW_GUEST_USERS']