Opened 8 years ago

Closed 7 years ago

#14424 closed (fixed)

rel_to undefined in init scope of RelatedFieldWidgetWrapper

Reported by: Rob Hudson Owned by: nobody
Component: contrib.admin Version: 1.3-alpha
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


While perusing code in the admin I noticed that this variable is undefined in the RelatedFieldWidgetWrapper.init. I was on the hunt for something else but thought I'd log this as a bug since it'll likely always be false...

        if can_add_related is None:
            can_add_related = rel_to in self.admin_site._registry

I believe, on cursory glance, that this should be instead.

Attachments (1)

admin_widget.diff (652 bytes) - added by fantomas42@… 7 years ago.
Patch for issue 14424

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by fantomas42@…

Attachment: admin_widget.diff added

Patch for issue 14424

comment:1 Changed 7 years ago by fantomas42@…

Version: 1.21.3-alpha

This bug is not present in the 1.2.x versions but he is present in the 1.3-alpha-1

And 2 mistakes are present in this line. See patch for correction.

comment:2 Changed 7 years ago by anonymous

Has patch: set

Bug introduced in revision [13708]

comment:3 Changed 7 years ago by Alex Gaynor

Resolution: fixed
Status: newclosed

(In [14683]) Fixed #14424 -- corrected a NameError when instantiating a RelatedFieldWidgetWrapper.

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