Do not allow to bulk-set empty names for subevents (Z#23194943) (#5184)

This commit is contained in:
Raphael Michel
2025-05-30 13:29:18 +02:00
committed by GitHub
parent e6dd24b9d5
commit 1752b2f037

View File

@@ -178,6 +178,13 @@ class SubEventBulkEditForm(I18nModelForm):
widgets = {
}
def clean(self):
data = super().clean()
if self.prefix + "name" in self.data.getlist('_bulk'):
if not data.get("name"):
self.add_error("name", _("This field is required."))
return data
def save(self, commit=True):
objs = list(self.queryset)
fields = set()