Fix pw reset of non-registered memberships

This commit is contained in:
Nikolai Kristiansen committed 2017-04-10 15:59:29 +02:00
1 parent 6f5a2f091d
commit 135e7493f8
1 file changed
+8
+8
View File
@@ -60,6 +60,14 @@ class NeufSetPasswordForm(SetPasswordForm):
return raw_password
def clean(self):
if self.user.username is None:
url = '<a href="https://inside.studentersamfundet.no/sms/register.php">her</a>'
raise ValidationError(
'Du må fullføre registrering av medlemskapet ditt før du kan bytte passord. Det gjør du {url}.'.format(url=url))
return super(NeufSetPasswordForm, self).clean()
class NeufPasswordChangeForm(NeufSetPasswordForm):
pass