mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Call plugin's installed() method upon event creation (#2089)
Co-authored-by: Raphael Michel <mail@raphaelmichel.de>
This commit is contained in:
@@ -637,6 +637,11 @@ class Event(EventMixin, LoggedModel):
|
||||
Quota,
|
||||
)
|
||||
|
||||
# Note: avoid self.set_active_plugins(), it causes trouble e.g. for the badges plugin.
|
||||
# Plugins can create data in installed() hook based on existing data of the event.
|
||||
# Calling set_active_plugins() results in defaults being created while actually data
|
||||
# should come from the copied event. Instead plugins should use event_copy_data to move
|
||||
# over their data.
|
||||
self.plugins = other.plugins
|
||||
self.is_public = other.is_public
|
||||
if other.date_admission:
|
||||
|
||||
@@ -1402,7 +1402,7 @@ class QuickSetupView(FormView):
|
||||
})
|
||||
quota.items.add(*items)
|
||||
|
||||
self.request.event.plugins = ",".join(plugins_active)
|
||||
self.request.event.set_active_plugins(plugins_active, allow_restricted=True)
|
||||
self.request.event.save()
|
||||
messages.success(self.request, _('Your changes have been saved. You can now go on with looking at the details '
|
||||
'or take your event live to start selling!'))
|
||||
|
||||
@@ -251,7 +251,7 @@ class EventWizard(SafeSessionWizardView):
|
||||
with transaction.atomic(), language(basics_data['locale']):
|
||||
event = form_dict['basics'].instance
|
||||
event.organizer = foundation_data['organizer']
|
||||
event.plugins = settings.PRETIX_PLUGINS_DEFAULT
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user