From 584d869729ea47471d1896b49aa43357f999bb85 Mon Sep 17 00:00:00 2001 From: Maico Timmerman Date: Tue, 22 Jun 2021 09:26:21 +0200 Subject: [PATCH] Event creation: call plugin installed() after persisting event (#2133) With #2089, PluginConfig.installed() is also called for newly created events. However, the passed event argument is still not committed. The plugins cannot use the event to insert or select objects, as it does not have an ID yet. --- src/pretix/control/views/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pretix/control/views/main.py b/src/pretix/control/views/main.py index ce6622fe1e..2dc260675b 100644 --- a/src/pretix/control/views/main.py +++ b/src/pretix/control/views/main.py @@ -262,10 +262,10 @@ class EventWizard(SafeSessionWizardView): with transaction.atomic(), language(basics_data['locale']): event = form_dict['basics'].instance event.organizer = foundation_data['organizer'] - event.set_active_plugins(settings.PRETIX_PLUGINS_DEFAULT.split(","), allow_restricted=True) event.has_subevents = foundation_data['has_subevents'] event.testmode = True form_dict['basics'].save() + event.set_active_plugins(settings.PRETIX_PLUGINS_DEFAULT.split(","), allow_restricted=True) event.log_action( 'pretix.event.added', user=self.request.user,