From a6de586b80aac055d8c8d7e2ed9ba6c9a8518d57 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sat, 23 Mar 2019 23:42:58 +0100 Subject: [PATCH] Make ItemBundle.designated_price non-nullable --- .../migrations/0115_auto_20190323_2238.py | 24 +++++++++++++++++++ src/pretix/base/models/items.py | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/pretix/base/migrations/0115_auto_20190323_2238.py diff --git a/src/pretix/base/migrations/0115_auto_20190323_2238.py b/src/pretix/base/migrations/0115_auto_20190323_2238.py new file mode 100644 index 000000000..6559ab246 --- /dev/null +++ b/src/pretix/base/migrations/0115_auto_20190323_2238.py @@ -0,0 +1,24 @@ +# Generated by Django 2.1.7 on 2019-03-23 22:38 + +from decimal import Decimal + +import django.db.models.deletion +import jsonfallback.fields +from django.db import migrations, models + +import pretix.base.models.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('pretixbase', '0114_auto_20190316_1014'), + ] + + operations = [ + migrations.AlterField( + model_name='itembundle', + name='designated_price', + field=models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), help_text="If set, it will be shown that this bundled item is responsible for the given value of the total gross price. This might be important in cases of mixed taxation, but can be kept blank otherwise. This value will NOT be added to the base item's price.", max_digits=10, verbose_name='Designated price part'), + ), + ] diff --git a/src/pretix/base/models/items.py b/src/pretix/base/models/items.py index fee963a25..22d584c5e 100644 --- a/src/pretix/base/models/items.py +++ b/src/pretix/base/models/items.py @@ -818,7 +818,7 @@ class ItemBundle(models.Model): verbose_name=_('Number') ) designated_price = models.DecimalField( - null=True, blank=True, + default=Decimal('0.00'), blank=True, decimal_places=2, max_digits=10, verbose_name=_('Designated price part'), help_text=_('If set, it will be shown that this bundled item is responsible for the given value of the total '