mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-22 16:03:19 +01:00
Fixes GH-54: Stats crash without open tickets. This should have already been caught, so this patch fixes it and adds another sanity check at report runtime.
This commit is contained in:
parent
701d742840
commit
5278634a76
@ -3,7 +3,7 @@
|
|||||||
{% block helpdesk_title %}{% trans "Reports & Statistics" %}{% endblock %}
|
{% block helpdesk_title %}{% trans "Reports & Statistics" %}{% endblock %}
|
||||||
|
|
||||||
{% block helpdesk_body %}
|
{% block helpdesk_body %}
|
||||||
{% ifequal num_tickets 0 %}{% blocktrans %}
|
{% ifequal number_tickets 0 %}{% blocktrans %}
|
||||||
<h2>Reports & Statistics</h2>
|
<h2>Reports & Statistics</h2>
|
||||||
|
|
||||||
<p>You haven't created any tickets yet, so you cannot run any reports.</p>
|
<p>You haven't created any tickets yet, so you cannot run any reports.</p>
|
||||||
|
@ -751,6 +751,8 @@ report_index = staff_member_required(report_index)
|
|||||||
|
|
||||||
|
|
||||||
def run_report(request, report):
|
def run_report(request, report):
|
||||||
|
if Ticket.objects.all().count() == 0:
|
||||||
|
return HttpResponseRedirect(reverse("helpdesk_report_index"))
|
||||||
priority_sql = []
|
priority_sql = []
|
||||||
priority_columns = []
|
priority_columns = []
|
||||||
for p in Ticket.PRIORITY_CHOICES:
|
for p in Ticket.PRIORITY_CHOICES:
|
||||||
|
Loading…
Reference in New Issue
Block a user