diff --git a/passbook/core/auth/factor.py b/passbook/core/auth/factor.py index d04d40ff6..91427651f 100644 --- a/passbook/core/auth/factor.py +++ b/passbook/core/auth/factor.py @@ -17,7 +17,7 @@ class AuthenticationFactor(TemplateView): authenticator = None pending_user = None request = None - template_name = 'login/factors/base.html' + template_name = 'login/form_with_user.html' def __init__(self, authenticator): self.authenticator = authenticator @@ -27,5 +27,5 @@ class AuthenticationFactor(TemplateView): kwargs['is_login'] = True kwargs['title'] = _('Log in to your account') kwargs['primary_action'] = _('Log in') - kwargs['pending_user'] = self.pending_user + kwargs['user'] = self.pending_user return super().get_context_data(**kwargs) diff --git a/passbook/core/forms/authentication.py b/passbook/core/forms/authentication.py index b8fe9f4ee..e49fcc587 100644 --- a/passbook/core/forms/authentication.py +++ b/passbook/core/forms/authentication.py @@ -79,6 +79,10 @@ class SignUpForm(forms.Form): def clean_password_repeat(self): """Check if Password adheres to filter and if passwords matche""" + password = self.cleaned_data.get('password') + password_repeat = self.cleaned_data.get('password_repeat') + if password != password_repeat: + raise ValidationError(_("Passwords don't match")) # TODO: Password policy? Via Plugin? via Policy? # return check_password(self) return self.cleaned_data.get('password_repeat') diff --git a/passbook/core/templates/login/factors/backend.html b/passbook/core/templates/login/factors/backend.html index e0d656b03..b4b181d1d 100644 --- a/passbook/core/templates/login/factors/backend.html +++ b/passbook/core/templates/login/factors/backend.html @@ -1,4 +1,4 @@ -{% extends 'login/factors/base.html' %} +{% extends 'login/form_with_user.html' %} {% load i18n %} diff --git a/passbook/core/templates/login/factors/base.html b/passbook/core/templates/login/form_with_user.html similarity index 85% rename from passbook/core/templates/login/factors/base.html rename to passbook/core/templates/login/form_with_user.html index 5103b58f7..0a98c6b96 100644 --- a/passbook/core/templates/login/factors/base.html +++ b/passbook/core/templates/login/form_with_user.html @@ -23,8 +23,8 @@ {% block above_form %}
- - {{ pending_user.username }} + + {{ user.username }}
{% trans 'Not you?' %}