#15532 closed (fixed)
Improve error message for django.contrib.auth.load_backend
Reported by: | Mikhail Korobov | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi all,
If backend can't be imported for some reason, it now raises the following message (see django.contrib.auth.__init__.py
):
except ImportError, e: raise ImproperlyConfigured('Error importing authentication backend %s: "%s"' % (module, e))
This message contains module name. I think it is a good idea to change this to full backend name in order to simplify debugging:
except ImportError, e: raise ImproperlyConfigured('Error importing authentication backend %s: "%s"' % (path, e))
My case: custom django-registration registration backend (with supplying auth backend) that sets user.backend to wrong value (import path was incorrect, class name was correct). It was not easy to determine from existing error message which auth backend is failing because backend class name wasn't in error message.
Change History (3)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:2 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In [15713]: