Code

Ticket #11042: mir-11042.diff

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

patch

Line 
1diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
2index 7807e72..d87f717 100644
3--- a/django/contrib/admin/helpers.py
4+++ b/django/contrib/admin/helpers.py
5@@ -146,10 +146,7 @@ class InlineAdminForm(AdminForm):
6             yield InlineFieldset(self.formset, self.form, name, **options)
7 
8     def has_auto_field(self):
9-        for field in self.form._meta.model._meta.fields:
10-            if field.auto_created:
11-                return True
12-        return False
13+        return self.form._meta.model._meta.has_auto_field
14 
15     def field_count(self):
16         # tabular.html uses this function for colspan value.