From a326ee8f75a8e2525f2069b479307ba6e8dcc19b Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Fri, 18 Oct 2019 17:43:43 +0200 Subject: [PATCH] Prevent creating negative gift code values --- src/pretix/control/forms/organizer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pretix/control/forms/organizer.py b/src/pretix/control/forms/organizer.py index 442458269..88015c61f 100644 --- a/src/pretix/control/forms/organizer.py +++ b/src/pretix/control/forms/organizer.py @@ -1,3 +1,4 @@ +from decimal import Decimal from urllib.parse import urlparse from django import forms @@ -334,7 +335,8 @@ class WebHookForm(forms.ModelForm): class GiftCardCreateForm(forms.ModelForm): value = forms.DecimalField( - label=_('Gift card value') + label=_('Gift card value'), + min_value=Decimal('0.00') ) def __init__(self, *args, **kwargs):