Prevent creating negative gift code values

This commit is contained in:
Raphael Michel
2019-10-18 17:43:43 +02:00
parent 147b90b9e8
commit a326ee8f75

View File

@@ -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):