Ticket #2189: optimize_auth.diff
File optimize_auth.diff, 644 bytes (added by , 18 years ago) |
---|
-
models.py
160 160 def get_all_permissions(self): 161 161 if not hasattr(self, '_perm_cache'): 162 162 import sets 163 self._perm_cache = sets.Set(["%s.%s" % (p.content_type.app_label, p.codename) for p in self.user_permissions. all()])163 self._perm_cache = sets.Set(["%s.%s" % (p.content_type.app_label, p.codename) for p in self.user_permissions.select_related()]) 164 164 self._perm_cache.update(self.get_group_permissions()) 165 165 return self._perm_cache 166 166