Code

Opened 4 years ago

Closed 4 years ago

#14424 closed (fixed)

rel_to undefined in init scope of RelatedFieldWidgetWrapper

Reported by: robhudson 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:

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@… 4 years ago.
Patch for issue 14424

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by fantomas42@…

Patch for issue 14424

comment:1 Changed 4 years ago by fantomas42@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Version changed from 1.2 to 1.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 4 years ago by anonymous

  • Has patch set

Bug introduced in revision [13708]

comment:3 Changed 4 years ago by Alex

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

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

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.