#1344 closed defect (fixed)
[patch] magic-removal: fix in User model
| Reported by: | 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 , 20 years ago
comment:2 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
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.