From cb50f2a3bea93a873d844945918debf30b1f6f5f Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Tue, 13 Sep 2016 18:53:01 +1000 Subject: [PATCH] Replaces a bunch of reports with QuerysetReports --- registrasion/reporting/views.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/registrasion/reporting/views.py b/registrasion/reporting/views.py index bb89ae1a..88f4eada 100644 --- a/registrasion/reporting/views.py +++ b/registrasion/reporting/views.py @@ -227,23 +227,11 @@ def credit_notes(request, form): "invoice__user__attendee__attendeeprofilebase", ) - headings = [ - "id", "Owner", "Status", "Value", - ] - - data = [] - for note in notes: - data.append([ - note.id, - note.invoice.user.attendee.attendeeprofilebase.invoice_recipient(), - note.status, - note.value, - ]) - - return ListReport( + return QuerysetReport( "Credit Notes", - headings, - data, + ["id", "invoice__user__attendee__attendeeprofilebase__invoice_recipient", "status", "value"], # NOQA + notes, + headings=["id", "Owner", "Status", "Value"], link_view=views.credit_note, )