From 7895210aea542303fab63308d79626c58fac1e85 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Wed, 21 Dec 2022 09:21:17 +0100 Subject: [PATCH] Add default date on snapshots --- nummi/main/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nummi/main/models.py b/nummi/main/models.py index 3e777e4..664cc09 100644 --- a/nummi/main/models.py +++ b/nummi/main/models.py @@ -117,7 +117,7 @@ class InvoiceForm(ModelForm): class Snapshot(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) - date = models.DateField(unique=True, verbose_name=_("Date")) + date = models.DateField(default=date.today, unique=True, verbose_name=_("Date")) value = models.DecimalField( max_digits=12, decimal_places=2, default=0, verbose_name=_("Value") )