magic-removal: Fixed #1344 - old-style related objects lookup in User model. Thanks, poissonnier.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2006-02-11 11:08:05 +00:00
parent 70e75036a8
commit c9839b85e5
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ class User(models.Model):
def get_all_permissions(self): def get_all_permissions(self):
if not hasattr(self, '_perm_cache'): if not hasattr(self, '_perm_cache'):
import sets import sets
self._perm_cache = sets.Set(["%s.%s" % (p.package_id, p.codename) for p in self.get_permission_list()]) self._perm_cache = sets.Set(["%s.%s" % (p.package_id, p.codename) for p in self.user_permissions.all()])
self._perm_cache.update(self.get_group_permissions()) self._perm_cache.update(self.get_group_permissions())
return self._perm_cache return self._perm_cache