diff --git a/src/pretix/control/templates/pretixcontrol/events/create_base.html b/src/pretix/control/templates/pretixcontrol/events/create_base.html index cde3f3adfe..f0ab5b0873 100644 --- a/src/pretix/control/templates/pretixcontrol/events/create_base.html +++ b/src/pretix/control/templates/pretixcontrol/events/create_base.html @@ -6,22 +6,33 @@

{% trans "Create a new event" %} {% blocktrans trimmed with step=wizard.steps.step1 %} Step {{ step }} {% endblocktrans %}

-
- {% csrf_token %} - {{ wizard.management_form }} - {% bootstrap_form_errors form %} - {% block form %} - {% endblock %} -
- {% if wizard.steps.prev %} - + {% endif %} + - {% endif %} - +
+
+ {% else %} +
+ {% trans "Every event needs to be created as part of an organizer account. Currently, you do not have access to any organizer accounts." %}
- + {% if request.user.is_superuser %} + + {% trans "Create a new organizer" %} + + {% endif %} + {% endif %} {% endblock %} diff --git a/src/pretix/control/views/main.py b/src/pretix/control/views/main.py index d3cea5e390..31fdeaa957 100644 --- a/src/pretix/control/views/main.py +++ b/src/pretix/control/views/main.py @@ -7,7 +7,7 @@ from django.utils.translation import ugettext_lazy as _ from django.views.generic import ListView from formtools.wizard.views import SessionWizardView -from pretix.base.models import Event, EventPermission +from pretix.base.models import Event, EventPermission, OrganizerPermission from pretix.control.forms.event import ( EventWizardBasicsForm, EventWizardCopyForm, EventWizardFoundationForm, ) @@ -48,6 +48,12 @@ class EventWizard(SessionWizardView): 'copy': condition_copy } + def get_context_data(self, form, **kwargs): + ctx = super().get_context_data(form, **kwargs) + ctx['has_organizer'] = OrganizerPermission.objects.filter(user=self.request.user, + can_create_events=True).exists() + return ctx + def get_form_kwargs(self, step=None): kwargs = { 'user': self.request.user