Self hosted FLOSS fitness/workout, nutrition and weight tracker
Change label on username field used for login
Roland Geider39ff0a462767
diff --git a/wger/core/forms.py b/wger/core/forms.pyindex 45d430711..00a62a689 100644--- a/wger/core/forms.py+++ b/wger/core/forms.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public Licensefrom captcha.fields import ReCaptchaField-from django.contrib.auth.forms import UserCreationForm+from django.contrib.auth.forms import UserCreationForm, AuthenticationFormfrom django.contrib.auth.models import Userfrom django.core.exceptions import ValidationErrorfrom django import forms@@ -30,6 +30,15 @@ from django.utils.translation import ugettext as _from wger.core.models import UserProfile+class UserLoginForm(AuthenticationForm):+ '''+ Form for logins++ Overwritten here just to change the label on the 'username' field+ '''+ username = forms.CharField(label=_("Username or email"), max_length=254)++class UserPreferencesForm(forms.ModelForm):class Meta:model = UserProfilediff --git a/wger/core/views/user.py b/wger/core/views/user.pyindex d4df4faac..b18b1cdd7 100644--- a/wger/core/views/user.py+++ b/wger/core/views/user.py@@ -45,8 +45,8 @@ from wger.core.forms import (UserPersonalInformationForm,PasswordConfirmationForm,RegistrationForm,- RegistrationFormNoCaptcha-)+ RegistrationFormNoCaptcha,+ UserLoginForm)from wger.core.models import Languagefrom wger.manager.models import (WorkoutLog,@@ -73,6 +73,7 @@ def login(request):return django_loginview(request,template_name='user/login.html',+ authentication_form=UserLoginForm,extra_context=context)diff --git a/wger/software/templates/changelog.html b/wger/software/templates/changelog.htmlindex 9008040ff..6e9dd773f 100644--- a/wger/software/templates/changelog.html+++ b/wger/software/templates/changelog.html@@ -11,6 +11,10 @@<h4>2015-XX-XX</h4><ul>+ <li>+ Allow login with username or email+ <a href="https://github.com/rolandgeider/wger/issues/164">#164</a>+ </li><li>Fix problem with datepicker<a href="https://github.com/rolandgeider/wger/issues/192">#192</a>