Refs #29358 -- Corrected wording in primary key check message.
This commit is contained in:
parent
816b8d9518
commit
21fd8041c1
|
@ -1443,7 +1443,8 @@ class Model(metaclass=ModelBase):
|
||||||
if sum(1 for f in cls._meta.local_fields if f.primary_key) > 1:
|
if sum(1 for f in cls._meta.local_fields if f.primary_key) > 1:
|
||||||
errors.append(
|
errors.append(
|
||||||
checks.Error(
|
checks.Error(
|
||||||
"Model can not contain more than one 'primary_key' field.",
|
"The model cannot have more than one field with "
|
||||||
|
"'primary_key=True'.",
|
||||||
obj=cls,
|
obj=cls,
|
||||||
id='models.E026',
|
id='models.E026',
|
||||||
)
|
)
|
||||||
|
|
|
@ -295,7 +295,8 @@ Models
|
||||||
as it collides with the query lookup syntax.
|
as it collides with the query lookup syntax.
|
||||||
* **models.E025**: The property ``<property name>`` clashes with a related
|
* **models.E025**: The property ``<property name>`` clashes with a related
|
||||||
field accessor.
|
field accessor.
|
||||||
* **models.E026**: Model can not contain more than one ``primary_key`` field.
|
* **models.E026**: The model cannot have more than one field with
|
||||||
|
``primary_key=True``.
|
||||||
|
|
||||||
Security
|
Security
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -724,7 +724,7 @@ class OtherModelTests(SimpleTestCase):
|
||||||
|
|
||||||
self.assertEqual(Model.check(), [
|
self.assertEqual(Model.check(), [
|
||||||
Error(
|
Error(
|
||||||
"Model can not contain more than one 'primary_key' field.",
|
"The model cannot have more than one field with 'primary_key=True'.",
|
||||||
obj=Model,
|
obj=Model,
|
||||||
id='models.E026',
|
id='models.E026',
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue