Ticket #11042: mir-11042.diff

File mir-11042.diff, 645 bytes (added by mir, 6 years ago)

patch

  • django/contrib/admin/helpers.py

    diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
    index 7807e72..d87f717 100644
    a b class InlineAdminForm(AdminForm): 
    146146            yield InlineFieldset(self.formset, self.form, name, **options)
    147147
    148148    def has_auto_field(self):
    149         for field in self.form._meta.model._meta.fields:
    150             if field.auto_created:
    151                 return True
    152         return False
     149        return self.form._meta.model._meta.has_auto_field
    153150
    154151    def field_count(self):
    155152        # tabular.html uses this function for colspan value.
Back to Top