#12103: Setting in contrib.auth AuthenticationForm to let inactive users log in
----------------------------+-----------------------------------------------
Reporter: ejucovy | Owner: nobody
Status: new | Milestone:
Component: Authentication | Version: 1.1
Keywords: | Stage: Unreviewed
Has_patch: 0 |
----------------------------+-----------------------------------------------
I've built a site that uses django-registration to manage user account
creation. I allow inactive users to log in, with minimal functionality: I
use middleware to kick them to a page that reminds them to confirm their
account.
To do this, I copied the whole `AuthenticationForm.clean()` method from
`django.contrib.auth.forms` to my custom authentication_form, and removed
two lines:
{{{
elif not self.user_cache.is_active:
raise forms.ValidationError(_("This account is inactive."))
}}}
From my code's perspective, it would be nicer if the base
`AuthenticationForm` had a class-level setting to toggle whether this
check happens. Then all I would have to do is subclass the form with an
override, like
{{{
class MyAuthenticationForm(AuthenticationForm):
allow_inactive_logins = True
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/12103>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---