﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28673	Make null=True explicitly uncombinable with auto_now=True	Дилян Палаузов	nobody	"{{{
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -1147,6 +1147,13 @@ class DateTimeCheckMixin(object):
         # auto_now, auto_now_add, and default are mutually exclusive
         # options. The use of more than one of these options together
         # will trigger an Error
+        if self.auto_now and self.null:
+            return [
+                checks.Error(
+                   ""The option null=True cannot be used with auto_now."",
+                   obj=self,
+                   id='fields.E161',
+                )]
         mutually_exclusive_options = [self.auto_now_add, self.auto_now, self.has_default()]
         enabled_options = [option not in (None, False) for option in mutually_exclusive_options].count(True)
         if enabled_options > 1:
diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt
--- a/docs/ref/checks.txt
+++ b/docs/ref/checks.txt
@@ -167,6 +167,7 @@ Model fields
   null values are not allowed, as blank values are stored as nulls.
 * **fields.E160**: The options ``auto_now``, ``auto_now_add``, and ``default``
   are mutually exclusive. Only one of these options may be present.
+* **fields.E161**: ``null=True`` cannot be used with ``auto_now``.
 * **fields.W161**: Fixed default value provided.
 * **fields.E900**: ``IPAddressField`` has been removed except for support in
   historical migrations.
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -503,7 +503,8 @@ optional arguments:
 
     Automatically set the field to now every time the object is saved. Useful
     for ""last-modified"" timestamps. Note that the current date is *always*
-    used; it's not just a default value that you can override.
+    used; it's not just a default value that you can override, hence this cannot
+    be combined with ``null=True``.
 
     The field is only automatically updated when calling :meth:`Model.save()
     <django.db.models.Model.save>`. The field isn't updated when making updates
}}}"	Uncategorized	closed	Database layer (models, ORM)	1.11	Normal	invalid			Unreviewed	0	0	0	0	0	0
