forked from CGM_Public/pretix_original
Respect testmode in CloneEventSerializer
This commit is contained in:
@@ -164,6 +164,7 @@ class CloneEventSerializer(EventSerializer):
|
|||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
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)
|
||||||
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()
|
||||||
@@ -173,6 +174,8 @@ class CloneEventSerializer(EventSerializer):
|
|||||||
new_event.set_active_plugins(plugins)
|
new_event.set_active_plugins(plugins)
|
||||||
if is_public is not None:
|
if is_public is not None:
|
||||||
new_event.is_public = is_public
|
new_event.is_public = is_public
|
||||||
|
if testmode is not None:
|
||||||
|
new_event.testmode = testmode
|
||||||
new_event.save()
|
new_event.save()
|
||||||
|
|
||||||
return new_event
|
return new_event
|
||||||
|
|||||||
Reference in New Issue
Block a user