Ticket #14424: admin_widget.diff

File admin_widget.diff, 652 bytes (added by fantomas42@…, 13 years ago)

Patch for issue 14424

  • contrib/admin/widgets.py

    diff --git a/contrib/admin/widgets.py b/contrib/admin/widgets.py
    index 0f567bd..f06c5e4 100644
    a b class RelatedFieldWidgetWrapper(forms.Widget):  
    203203        # Backwards compatible check for whether a user can add related
    204204        # objects.
    205205        if can_add_related is None:
    206             can_add_related = rel_to in self.admin_site._registry
     206            can_add_related = rel.to in admin_site._registry
    207207        self.can_add_related = can_add_related
    208208        # so we can check if the related object is registered with this AdminSite
    209209        self.admin_site = admin_site
Back to Top