Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1344 closed defect (fixed)

[patch] magic-removal: fix in User model

Reported by: poissonnier@… Owned by: Adrian Holovaty
Component: Tools Version: magic-removal
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Update to use descriptor fields:

Index: django/contrib/auth/models.py
===================================================================
--- django/contrib/auth/models.py	(revision 2304)
+++ django/contrib/auth/models.py	(working copy)
@@ -156,7 +156,7 @@
     def get_all_permissions(self):
         if not hasattr(self, '_perm_cache'):
             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())
         return self._perm_cache
 

Note: I am new to django and bugreporting in general, if I could have done something better, please tell me so.

Change History (2)

comment:1 by Luke Plant, 19 years ago

Thanks for the patch, that's great. The only thing you could have done *slightly* better would be to upload the patch as an attachment (slightly easier to work with, and gets a nice diff viewer) - but for a small thing like this it's no big deal.

comment:2 by Luke Plant, 19 years ago

Resolution: fixed
Status: newclosed

(In [2305]) magic-removal: Fixed #1344 - old-style related objects lookup in User model. Thanks, poissonnier.

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