Subject: [PATCH] django-helpers-fix
---
Index: django/contrib/admin/helpers.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
--- a/django/contrib/admin/helpers.py	(revision 53719d6b5b745dd99b1ab9315afb242f706ebbf1)
+++ b/django/contrib/admin/helpers.py	(date 1713722440064)
@@ -498,6 +498,8 @@
             # Auto fields are editable, so check for auto or non-editable pk.
             self.form._meta.model._meta.auto_field
             or not self.form._meta.model._meta.pk.editable
+            # the primary key can be editable, but excluded from the inline as well
+            or self.form._meta.model._meta.pk.name in (self.form._meta.exclude or ())
             or
             # Also search any parents for an auto field. (The pk info is
             # propagated to child models so that does not need to be checked
