mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
@@ -401,6 +401,8 @@ class ItemCreateForm(I18nModelForm):
|
||||
'validity_dynamic_duration_months',
|
||||
'validity_dynamic_start_choice',
|
||||
'validity_dynamic_start_choice_day_limit',
|
||||
'media_type',
|
||||
'media_policy',
|
||||
)
|
||||
for f in fields:
|
||||
setattr(self.instance, f, getattr(src, f))
|
||||
@@ -592,6 +594,10 @@ class ItemUpdateForm(I18nModelForm):
|
||||
del self.fields['grant_membership_duration_days']
|
||||
del self.fields['grant_membership_duration_months']
|
||||
|
||||
if not self.event.settings.reusable_media_active:
|
||||
del self.fields['media_type']
|
||||
del self.fields['media_policy']
|
||||
|
||||
def clean(self):
|
||||
d = super().clean()
|
||||
if d['issue_giftcard']:
|
||||
@@ -635,6 +641,8 @@ class ItemUpdateForm(I18nModelForm):
|
||||
_("The start of validity must be before the end of validity.")
|
||||
)
|
||||
|
||||
Item.clean_media_settings(self.event, d.get('media_policy'), d.get('media_type'), d.get('issue_giftcard'))
|
||||
|
||||
return d
|
||||
|
||||
def clean_picture(self):
|
||||
@@ -693,6 +701,8 @@ class ItemUpdateForm(I18nModelForm):
|
||||
'validity_dynamic_duration_months',
|
||||
'validity_dynamic_start_choice',
|
||||
'validity_dynamic_start_choice_day_limit',
|
||||
'media_policy',
|
||||
'media_type',
|
||||
]
|
||||
field_classes = {
|
||||
'available_from': SplitDateTimeField,
|
||||
|
||||
Reference in New Issue
Block a user