altered data_date to accommodate null date values

This commit is contained in:
Rupika 2019-02-13 21:17:31 -08:00
parent ff3923d367
commit 614f7102ba
3 changed files with 3 additions and 3 deletions

View file

@ -34,7 +34,7 @@ class Field(models.Model):
completed = models.BooleanField(default=False)
data_bool = models.BooleanField(default=False)
data_decimal = models.DecimalField(max_digits=9, decimal_places=2, null=True, blank=True)
data_date = models.DateField(default=datetime.date.today)
data_date = models.DateField(null=True, blank=True)
data_file = models.FileField(upload_to='uploads/%Y/%m/%d/', max_length=512, null=True, blank=True)
data_string = models.TextField(default='', blank=True)
data_integer = models.IntegerField(default=0, blank=True)

View file

@ -185,8 +185,8 @@ def section(request, report_pk, section_pk):
request.data[key] == "" or
request.data[key] is None
):
update_field.data_date = datetime.date.today()
# update_field.data_date = None
# update_field.data_date = datetime.date.today()
update_field.data_date = None
else:
update_field.data_date = request.data[key]

Binary file not shown.