Add field length validation for invoice settings (Z#23215182) (#5639)

Limit invoice settings field lengths, add min value for counter length
This commit is contained in:
Phin Wolkwitz
2025-11-18 15:51:34 +01:00
committed by GitHub
parent 39ff84b2e2
commit 2fcfc336d0
2 changed files with 11 additions and 6 deletions

View File

@@ -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(