Opened 12 years ago

Closed 12 years ago

Last modified 12 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: UI/UX:


Update to use descriptor fields:

Index: django/contrib/auth/
--- django/contrib/auth/	(revision 2304)
+++ django/contrib/auth/	(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()])
         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 Changed 12 years ago by Luke Plant

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 Changed 12 years ago by Luke Plant

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