Revision 23c271b3

b/snf-astakos-app/astakos/im/forms.py
341 341
    Since Django 1.3 this is useless since ``django.contrib.auth.views.reset_password``
342 342
    accepts a from_email argument.
343 343
    """
344
    def clean_email(self):
345
        email = super(ExtendedPasswordResetForm, self).clean_email()
346
        try:
347
            user = AstakosUser.objects.get(email=email)
348
            if not user.has_usable_password():
349
                raise forms.ValidationError(_("This account has not a usable password."))
350
        except AstakosUser.DoesNotExist, e:
351
            raise forms.ValidationError(_('That e-mail address doesn\'t have an associated user account. Are you sure you\'ve registered?'))
352
        return email
353
    
344 354
    def save(self, domain_override=None, email_template_name='registration/password_reset_email.html',
345 355
             use_https=False, token_generator=default_token_generator, request=None):
346 356
        """

Also available in: Unified diff