diff --git a/django/core/meta/fields.py b/django/core/meta/fields.py index b13518c503..376595230c 100644 --- a/django/core/meta/fields.py +++ b/django/core/meta/fields.py @@ -596,8 +596,9 @@ class ForeignKey(Field): Field.__init__(self, **kwargs) def get_manipulator_field_objs(self): - if self.rel.raw_id_admin: - return self.rel.get_related_field().get_manipulator_field_objs() + rel_field = self.rel.get_related_field() + if self.rel.raw_id_admin and not isinstance(rel_field, AutoField): + return rel_field.get_manipulator_field_objs() else: return [formfields.IntegerField]