summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-01-17 10:45:31 +0000
committerAndrew Godwin <andrew@aeracode.org>2014-01-17 10:46:03 +0000
commit86e69bf3b67ff1e156413e07cef018ec52c2cdd4 (patch)
treefc8c84c6dd8f1a8680f875c093ca7cc9bcd56030 /django
parentdd98ccd4821f71543a5489d421ea2dee28901f17 (diff)
Fixed #21785: Bad handling of both auto_now and _add on deconstruct
Diffstat (limited to 'django')
-rw-r--r--django/db/models/fields/__init__.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index bc5c48da01..7172cf1a55 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -904,10 +904,9 @@ class DateField(Field):
name, path, args, kwargs = super(DateField, self).deconstruct()
if self.auto_now:
kwargs['auto_now'] = True
- del kwargs['editable']
- del kwargs['blank']
if self.auto_now_add:
kwargs['auto_now_add'] = True
+ if self.auto_now or self.auto_now_add:
del kwargs['editable']
del kwargs['blank']
return name, path, args, kwargs