mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-01-19 04:19:54 +01:00
Issue #125: If you have no tickets, the reports throw a 500 server error. This
patch removes the report links when there's no tickets in the system. Thanks to Kestutis Gustaitis for the bug report.
This commit is contained in:
parent
e15a2e3316
commit
2a67f37577
@ -29,3 +29,7 @@ volume of data in the system. This patch restricts the chart to 1000px wide.
|
||||
|
||||
2009-12-16 r146 Issue #121 Formatting fix for email subjects. Thanks,
|
||||
Andreas Kotowicz.
|
||||
|
||||
2009-12-16 r147 Issue #119 Update Russian translation, thanks to Alex Yakovlev
|
||||
|
||||
2009-12-23 r148 Issue #125 Errors occurring when running reports with no data
|
||||
|
@ -2,9 +2,17 @@
|
||||
|
||||
{% block helpdesk_title %}{% trans "Reports & Statistics" %}{% endblock %}
|
||||
|
||||
{% block helpdesk_body %}{% blocktrans %}
|
||||
{% block helpdesk_body %}
|
||||
{% ifequal num_tickets 0 %}{% blocktrans %}
|
||||
<h2>Reports & Statistics</h2>
|
||||
|
||||
<p>You haven't created any tickets yet, so you cannot run any reports.</p>
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans %}
|
||||
<h2>Reports & Statistics</h2>
|
||||
|
||||
|
||||
<ul>
|
||||
<li>User<ul>
|
||||
|
||||
@ -24,4 +32,4 @@
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
{% endblocktrans %}{% endblock %}
|
||||
{% endblocktrans %}{% endifequal %}{% endblock %}
|
||||
|
@ -703,8 +703,11 @@ rss_list = staff_member_required(rss_list)
|
||||
|
||||
|
||||
def report_index(request):
|
||||
number_tickets = Ticket.objects.all().count()
|
||||
return render_to_response('helpdesk/report_index.html',
|
||||
RequestContext(request, {}))
|
||||
RequestContext(request, {
|
||||
'number_tickets': number_tickets,
|
||||
}))
|
||||
report_index = staff_member_required(report_index)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user