Opened 5 years ago

Closed 5 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: UI/UX:

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

  1. SiteProfileNotAvailable if this site does not allow profiles.
  2. """
  3. if not hasattr(self, '_profile_cache'):
  4. from django.conf import settings
  5. if not getattr(settings, 'AUTH_PROFILE_MODULE', False):
  6. raise SiteProfileNotAvailable
  7. try:
  1. app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.') ...
  1. model = models.get_model(app_label, model_name)
  2. self._profile_cache = model._default_manager.get(useridexact=self.id)
  3. self._profile_cache.user = self
  4. except (ImportError, ImproperlyConfigured):
  5. raise SiteProfileNotAvailable
  6. return self._profile_cache

Best Regards,
JohnnyL

Change History (1)

comment:1 Changed 5 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

AUTH_PROFILE_MODULE should be "appname.model" as specified in the docs, not the Python Path to the mode.

Note: See TracTickets for help on using tickets.
Back to Top