From fa1aac03bba252985afccffc828fe1cdc18dfcda Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Tue, 3 Aug 2021 07:22:00 +0200 Subject: [PATCH] allow blank values, stupid django --- .../migrations/0021_auto_20210803_0521.py | 28 +++++++++++++++++++ src/tickets/models.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/tickets/migrations/0021_auto_20210803_0521.py diff --git a/src/tickets/migrations/0021_auto_20210803_0521.py b/src/tickets/migrations/0021_auto_20210803_0521.py new file mode 100644 index 00000000..f965dca9 --- /dev/null +++ b/src/tickets/migrations/0021_auto_20210803_0521.py @@ -0,0 +1,28 @@ +# Generated by Django 3.2.5 on 2021-08-03 05:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("tickets", "0020_populate_ticket_used_when"), + ] + + operations = [ + migrations.AlterField( + model_name="discountticket", + name="used_time", + field=models.DateTimeField(blank=True, null=True), + ), + migrations.AlterField( + model_name="shopticket", + name="used_time", + field=models.DateTimeField(blank=True, null=True), + ), + migrations.AlterField( + model_name="sponsorticket", + name="used_time", + field=models.DateTimeField(blank=True, null=True), + ), + ] diff --git a/src/tickets/models.py b/src/tickets/models.py index 47a690fa..376ec7ea 100644 --- a/src/tickets/models.py +++ b/src/tickets/models.py @@ -98,7 +98,7 @@ def qr_code_base64(token): class BaseTicket(CampRelatedModel, UUIDModel): ticket_type = models.ForeignKey("TicketType", on_delete=models.PROTECT) used = models.BooleanField(default=False) - used_time = models.DateTimeField(null=True) + used_time = models.DateTimeField(null=True, blank=True) badge_handed_out = models.BooleanField(default=False) token = models.CharField(max_length=64, blank=True) badge_token = models.CharField(max_length=64, blank=True)