Ticket #7584: django-default-profile.patch
File django-default-profile.patch, 993 bytes (added by , 16 years ago) |
---|
-
trunk/django/contrib/auth/models.py
305 305 try: 306 306 app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.') 307 307 model = models.get_model(app_label, model_name) 308 self._profile_cache = model._default_manager.get(user__id__exact=self.id) 308 try: 309 self._profile_cache = model._default_manager.get(user__id__exact=self.id) 310 except model.DoesNotExist: 311 if hasattr(model._default_manager, 'create_default_profile'): 312 return model._default_manager.create_default_profile(self) 313 raise 309 314 except (ImportError, ImproperlyConfigured): 310 315 raise SiteProfileNotAvailable 311 316 return self._profile_cache