1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #21785: Bad handling of both auto_now and _add on deconstruct

This commit is contained in:
Andrew Godwin
2014-01-17 10:45:31 +00:00
parent dd98ccd482
commit 86e69bf3b6
2 changed files with 7 additions and 2 deletions

View File

@@ -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