mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Fix #614 -- Warning message if ticket output is active but no provider
This commit is contained in:
@@ -6,6 +6,14 @@
|
||||
{% csrf_token %}
|
||||
<fieldset>
|
||||
<legend>{% trans "Ticket download" %}</legend>
|
||||
{% if request.event.settings.ticket_download and not any_enabled %}
|
||||
<div class="alert alert-warning">
|
||||
{% blocktrans trimmed %}
|
||||
You activated ticket downloads but no output provider is enabled. Be sure to enable a plugin and
|
||||
activate an output provider.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% bootstrap_form_errors form %}
|
||||
{% bootstrap_field form.ticket_download layout="horizontal" %}
|
||||
{% bootstrap_field form.ticket_download_date layout="horizontal" %}
|
||||
|
||||
@@ -585,6 +585,15 @@ class TicketSettings(EventPermissionRequiredMixin, FormView):
|
||||
def get_context_data(self, *args, **kwargs) -> dict:
|
||||
context = super().get_context_data(*args, **kwargs)
|
||||
context['providers'] = self.provider_forms
|
||||
|
||||
context['any_enabled'] = False
|
||||
responses = register_ticket_outputs.send(self.request.event)
|
||||
for receiver, response in responses:
|
||||
provider = response(self.request.event)
|
||||
if provider.is_enabled:
|
||||
context['any_enabled'] = True
|
||||
break
|
||||
|
||||
return context
|
||||
|
||||
def get_success_url(self) -> str:
|
||||
|
||||
Reference in New Issue
Block a user