Fix unique date field on snapshots

This commit is contained in:
Edgar P. Burkhart 2022-12-29 19:22:38 +01:00
parent 2ac316aaca
commit 7d0ed1dd5a
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,19 @@
# Generated by Django 4.1.4 on 2022-12-29 18:22
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("main", "0011_alter_category_user_alter_invoice_user_and_more"),
]
operations = [
migrations.AlterField(
model_name="snapshot",
name="date",
field=models.DateField(default=datetime.date.today, verbose_name="Date"),
),
]

View file

@ -189,7 +189,7 @@ def snapshot_path(instance, filename):
class Snapshot(UserModel): class Snapshot(UserModel):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
date = models.DateField(default=date.today, unique=True, verbose_name=_("Date")) date = models.DateField(default=date.today, verbose_name=_("Date"))
value = models.DecimalField( value = models.DecimalField(
max_digits=12, decimal_places=2, default=0, verbose_name=_("Value") max_digits=12, decimal_places=2, default=0, verbose_name=_("Value")
) )