diff options
| author | Almad <bugs@almad.net> | 2018-03-03 19:22:00 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-03-03 13:22:00 -0500 |
| commit | 3d8fadad0f7a3a32f28db034650182117ae071f7 (patch) | |
| tree | bc27577b4ee8dec7682e4fd79c98e7e3f0cfef99 /django | |
| parent | a20aae414e762e4d9043e76b0bf8eccd334c8ebc (diff) | |
Added model name to AutoField error message.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/fields/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index e9903a73b6..ea31096374 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -966,7 +966,7 @@ class AutoField(Field): return int(value) def contribute_to_class(self, cls, name, **kwargs): - assert not cls._meta.auto_field, "A model can't have more than one AutoField." + assert not cls._meta.auto_field, "Model %s can't have more than one AutoField." % cls._meta.label super().contribute_to_class(cls, name, **kwargs) cls._meta.auto_field = self |
