forked from CGM_Public/pretix_original
Fix #1377 -- Copy has_subevents when cloning events through the API
This commit is contained in:
@@ -239,6 +239,7 @@ class CloneEventSerializer(EventSerializer):
|
|||||||
plugins = validated_data.pop('plugins', None)
|
plugins = validated_data.pop('plugins', None)
|
||||||
is_public = validated_data.pop('is_public', None)
|
is_public = validated_data.pop('is_public', None)
|
||||||
testmode = validated_data.pop('testmode', None)
|
testmode = validated_data.pop('testmode', None)
|
||||||
|
has_subevents = validated_data.pop('has_subevents', None)
|
||||||
new_event = super().create(validated_data)
|
new_event = super().create(validated_data)
|
||||||
|
|
||||||
event = Event.objects.filter(slug=self.context['event'], organizer=self.context['organizer'].pk).first()
|
event = Event.objects.filter(slug=self.context['event'], organizer=self.context['organizer'].pk).first()
|
||||||
@@ -250,6 +251,8 @@ class CloneEventSerializer(EventSerializer):
|
|||||||
new_event.is_public = is_public
|
new_event.is_public = is_public
|
||||||
if testmode is not None:
|
if testmode is not None:
|
||||||
new_event.testmode = testmode
|
new_event.testmode = testmode
|
||||||
|
if has_subevents is not None:
|
||||||
|
new_event.has_subevents = has_subevents
|
||||||
new_event.save()
|
new_event.save()
|
||||||
|
|
||||||
return new_event
|
return new_event
|
||||||
|
|||||||
Reference in New Issue
Block a user