mirror of
https://github.com/pretix/pretix.git
synced 2026-08-23 12:51:59 +00:00
Item form: Validate empty dynamic validity
This commit is contained in:
@@ -744,6 +744,14 @@ class ItemUpdateForm(I18nModelForm):
|
|||||||
_("The start of validity must be before the end of validity.")
|
_("The start of validity must be before the end of validity.")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if d.get('validity_mode') == Item.VALIDITY_MODE_DYNAMIC:
|
||||||
|
if not any(d.get(f'validity_dynamic_duration_{k}') for k in ('months', 'days', 'hours', 'minutes')):
|
||||||
|
self.add_error(
|
||||||
|
'validity_dynamic_duration_months',
|
||||||
|
_("You have selected dynamic validity but have not entered a time period. This would render "
|
||||||
|
"the tickets unusable.")
|
||||||
|
)
|
||||||
|
|
||||||
Item.clean_media_settings(self.event, d.get('media_policy'), d.get('media_type'), d.get('issue_giftcard'))
|
Item.clean_media_settings(self.event, d.get('media_policy'), d.get('media_type'), d.get('issue_giftcard'))
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|||||||
Reference in New Issue
Block a user