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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user