Opened 15 years ago
Closed 15 years ago
#12366 closed (invalid)
AUTH_PROFILE_MODULE='borobeat.credit.BorobeatSiteProfileRecord'
Reported by: | johnnyl | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.1 |
Severity: | Keywords: | admin split AUTH_PROFILE_MODULE path | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If you use the above style (an extra '.' signfying the path of the app)
Because there is no extra parsing of the path (it only uses *1* split) you get the following error:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/credit/borobeatsiteprofilerecord/add/
Exception Type: ValueError
Exception Value:
too many values to unpack
Source Code:
C:\Python25\lib\site-packages\django\contrib\auth\models.py in get_profile
- SiteProfileNotAvailable if this site does not allow profiles.
- """
- if not hasattr(self, '_profile_cache'):
- from django.conf import settings
- if not getattr(settings, 'AUTH_PROFILE_MODULE', False):
- raise SiteProfileNotAvailable
- try:
- app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.') ...
- model = models.get_model(app_label, model_name)
- self._profile_cache = model._default_manager.get(useridexact=self.id)
- self._profile_cache.user = self
- except (ImportError, ImproperlyConfigured):
- raise SiteProfileNotAvailable
- return self._profile_cache
Best Regards,
JohnnyL
AUTH_PROFILE_MODULE should be "appname.model" as specified in the docs, not the Python Path to the mode.