浏览代码

Refs #21798 - Modified error number to provide room for future expansion.

Russell Keith-Magee 11 年之前
父节点
当前提交
2c176eb95c
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      django/db/models/fields/__init__.py
  2. 1 1
      docs/ref/checks.txt
  3. 1 1
      tests/invalid_models_tests/test_ordinary_fields.py

+ 1 - 1
django/db/models/fields/__init__.py

@@ -1097,7 +1097,7 @@ class DateTimeCheckMixin(object):
                     "may be present.",
                     hint=None,
                     obj=self,
-                    id='fields.E151',
+                    id='fields.E160',
                 )
             ]
         else:

+ 1 - 1
docs/ref/checks.txt

@@ -67,7 +67,7 @@ Fields
 * **fields.E134**: ``max_digits`` must be greater or equal to ``decimal_places``.
 * **fields.E140**: FilePathFields must have either ``allow_files`` or ``allow_folders`` set to True.
 * **fields.E150**: GenericIPAddressFields cannot accept blank values if null values are not allowed, as blank values are stored as nulls.
-* **fields.E151**: The options ``auto_now``, ``auto_now_add``, and ``default`` are mutually exclusive. Only one of these options may be present.
+* **fields.E160**: The options ``auto_now``, ``auto_now_add``, and ``default`` are mutually exclusive. Only one of these options may be present.
 
 File Fields
 ~~~~~~~~~~~

+ 1 - 1
tests/invalid_models_tests/test_ordinary_fields.py

@@ -423,7 +423,7 @@ class DateFieldTests(IsolatedModelsTestCase):
                     "may be present.",
                     hint=None,
                     obj=field,
-                    id='fields.E151',
+                    id='fields.E160',
                 )]
                 checks = field.check()
                 self.assertEqual(checks, expected)