Ticket #7584: django-profile-manager.patch

File django-profile-manager.patch, 911 bytes (added by David Danier <goliath.mailinglist@…>, 7 years ago)

New patch implementing different idea of solving this

  • trunk/django/contrib/auth/models.py

     
    305305            try:
    306306                app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.')
    307307                model = models.get_model(app_label, model_name)
    308                 self._profile_cache = model._default_manager.get(user__id__exact=self.id)
     308                if hasatttr(model._default_manager, 'get_for_user'):
     309                    self._profile_cache = model._default_manager.get_for_user(self)
     310                else:
     311                    self._profile_cache = model._default_manager.get(user__id__exact=self.id)
    309312            except (ImportError, ImproperlyConfigured):
    310313                raise SiteProfileNotAvailable
    311314        return self._profile_cache
Back to Top