Opened 14 years ago

Closed 14 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: no UI/UX: no

Description

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 rel.to instead.

Attachments (1)

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

Download all attachments as: .zip

Change History (4)

by fantomas42@…, 14 years ago

Attachment: admin_widget.diff added

Patch for issue 14424

comment:1 by fantomas42@…, 14 years ago

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 by anonymous, 14 years ago

Has patch: set

Bug introduced in revision [13708]

comment:3 by Alex Gaynor, 14 years ago

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