forked from CGM_Public/pretix_original
Event setup: do not create new team when staff session active (#2132)
With b260cca412, team provisioning has
been disabled for users that are staff. However, this leads to strange
UX, as a new event created by a staff member, not currently in a staff
session resulted in a 404 directly after creation.
The PR updates this requirement to not need to select a team, only when
a staff session is active.
This commit is contained in:
@@ -161,6 +161,7 @@ class EventWizard(SafeSessionWizardView):
|
||||
initial['locales'] = self.clone_from.settings.locales
|
||||
initial['has_subevents'] = self.clone_from.has_subevents
|
||||
elif step == 'basics':
|
||||
initial['request'] = self.request
|
||||
initial['name'] = self.clone_from.name
|
||||
|
||||
if re.match('^.*-[0-9]+$', self.clone_from.slug):
|
||||
@@ -270,7 +271,7 @@ class EventWizard(SafeSessionWizardView):
|
||||
user=self.request.user,
|
||||
)
|
||||
|
||||
if not EventWizardBasicsForm.has_control_rights(self.request.user, event.organizer):
|
||||
if not EventWizardBasicsForm.has_control_rights(self.request.user, event.organizer, self.request.session):
|
||||
if basics_data["team"] is not None:
|
||||
t = basics_data["team"]
|
||||
t.limit_events.add(event)
|
||||
|
||||
Reference in New Issue
Block a user