#19912: Authenticate users in multiple database
----------------------------------+--------------------------
Reporter: EvgeniyMakhmudov | Owner: nobody
Type: New feature | Status: new
Component: contrib.auth | Version: 1.4
Severity: Normal | Keywords: authenticate
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------
A problem occur while using several database (each contains users tables)
and don't using managers. Process authentication in Django is avaiable
only for users table in default database. My proposal is in small
modification in original (1.4) code:
{{{
# django.contrib.auth.backends.py
# class ModelBackend(object)
# ...
def authenticate(self, username=None, password=None,
database='default'):
try:
user = User.objects.using(database).get(username=username)
if user.check_password(password):
return user
except User.DoesNotExist:
return None
}}}
I don't tested this from global point of view, but in my app it is
working.
--
Ticket URL: <https://code.djangoproject.com/ticket/19912>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.