diff --git a/src/pretix/base/settings.py b/src/pretix/base/settings.py index 7c57318173..c2422fe692 100644 --- a/src/pretix/base/settings.py +++ b/src/pretix/base/settings.py @@ -690,6 +690,7 @@ DEFAULTS = { label=_("Minimum length of invoice number after prefix"), help_text=_("The part of your invoice number after your prefix will be filled up with leading zeros up to this length, e.g. INV-001 or INV-00001."), max_value=12, + min_value=1, required=True, ) }, @@ -725,8 +726,9 @@ DEFAULTS = { message=lazy(lambda *args: _('Please only use the characters {allowed} in this field.').format( allowed='A-Z, a-z, 0-9, -./:#' ), str)() - ) + ), ], + max_length=155, ) }, 'invoice_numbers_prefix_cancellations': { @@ -747,8 +749,9 @@ DEFAULTS = { message=lazy(lambda *args: _('Please only use the characters {allowed} in this field.').format( allowed='A-Z, a-z, 0-9, -./:#' ), str)() - ) + ), ], + max_length=155, ) }, 'invoice_renderer_highlight_order_code': { @@ -1203,6 +1206,7 @@ DEFAULTS = { 'form_class': forms.CharField, 'serializer_class': serializers.CharField, 'form_kwargs': dict( + max_length=190, label=_("Company name"), ) }, @@ -1216,6 +1220,7 @@ DEFAULTS = { 'placeholder': '12345' }), label=_("ZIP code"), + max_length=190, ) }, 'invoice_address_from_city': { @@ -1228,6 +1233,7 @@ DEFAULTS = { 'placeholder': _('Random City') }), label=_("City"), + max_length=190, ) }, 'invoice_address_from_state': { @@ -1264,7 +1270,8 @@ DEFAULTS = { 'serializer_class': serializers.CharField, 'form_kwargs': dict( label=_("Domestic tax ID"), - help_text=_("e.g. tax number in Germany, ABN in Australia, …") + help_text=_("e.g. tax number in Germany, ABN in Australia, …"), + max_length=190, ) }, 'invoice_address_from_vat_id': { @@ -1274,6 +1281,7 @@ DEFAULTS = { 'serializer_class': serializers.CharField, 'form_kwargs': dict( label=_("EU VAT ID"), + max_length=190, ) }, 'invoice_introductory_text': { diff --git a/src/pretix/control/forms/event.py b/src/pretix/control/forms/event.py index fbfdb08fed..8402d35e21 100644 --- a/src/pretix/control/forms/event.py +++ b/src/pretix/control/forms/event.py @@ -42,7 +42,6 @@ import pycountry from django import forms from django.conf import settings from django.core.exceptions import NON_FIELD_ERRORS, ValidationError -from django.core.validators import MaxValueValidator from django.db.models import Prefetch, Q, prefetch_related_objects from django.forms import formset_factory, inlineformset_factory from django.urls import reverse @@ -1000,8 +999,6 @@ class InvoiceSettingsForm(EventSettingsValidationMixin, SettingsForm): self.fields['invoice_generate_sales_channels'].choices = ( (c.identifier, c.label) for c in event.organizer.sales_channels.all() ) - self.fields['invoice_numbers_counter_length'].validators.append(MaxValueValidator(15)) - pps = [str(pp.verbose_name) for pp in event.get_payment_providers().values() if pp.requires_invoice_immediately] if pps: generate_paid_help_text = _('An invoice will be issued before payment if the customer selects one of the following payment methods: {list}').format(