Code

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#1316 closed defect (fixed)

[patch] one more bug fix for admin interface

Reported by: jpaulofarias at gmail dot com Owned by: adrian
Component: contrib.admin Version: magic-removal
Severity: normal Keywords: admin, db
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Removed one more reference to 'get_%s_list' when it should be '%s_set'.all()

Index: django/db/models/base.py
===================================================================
--- django/db/models/base.py	(revision 2230)
+++ django/db/models/base.py	(working copy)
@@ -211,7 +211,7 @@
                 else:
                     sub_obj.__collect_sub_objects(seen_objs)
             else:
-                for sub_obj in getattr(self, 'get_%s_list' % rel_opts_name)():
+                for sub_obj in getattr(self, '%s_set' % rel_opts_name).all():
                     sub_obj.__collect_sub_objects(seen_objs)
 
     def delete(self):

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by adrian

I believe the logic that creates the '_set' name is isolated in one place; i.e., '_set' shouldn't be hard-coded here.

comment:2 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [2248].

comment:3 Changed 7 years ago by adrian

  • milestone Version 0.91 deleted

Milestone Version 0.91 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.