From f2a18325b6a30132717227db671594e6ff5a942b Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Mon, 15 Feb 2021 13:41:44 +0100 Subject: [PATCH] =?UTF-8?q?Add=20a=20voucher=E2=80=99s=20comment=20to=20vo?= =?UTF-8?q?ucher.csv=20download=20(#1926)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pretix/control/views/vouchers.py | 6 ++++-- src/tests/control/test_vouchers.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pretix/control/views/vouchers.py b/src/pretix/control/views/vouchers.py index d98b13713..06e1f5c8a 100644 --- a/src/pretix/control/views/vouchers.py +++ b/src/pretix/control/views/vouchers.py @@ -67,7 +67,8 @@ class VoucherList(PaginationMixin, EventPermissionRequiredMixin, ListView): headers = [ _('Voucher code'), _('Valid until'), _('Product'), _('Reserve quota'), _('Bypass quota'), - _('Price effect'), _('Value'), _('Tag'), _('Redeemed'), _('Maximum usages'), _('Seat') + _('Price effect'), _('Value'), _('Tag'), _('Redeemed'), _('Maximum usages'), _('Seat'), + _('Comment') ] writer.writerow(headers) @@ -92,7 +93,8 @@ class VoucherList(PaginationMixin, EventPermissionRequiredMixin, ListView): v.tag, str(v.redeemed), str(v.max_usages), - str(v.seat) if v.seat else "" + str(v.seat) if v.seat else "", + str(v.comment) if v.comment else "" ] writer.writerow(row) diff --git a/src/tests/control/test_vouchers.py b/src/tests/control/test_vouchers.py index 2e8322401..58a3346d7 100644 --- a/src/tests/control/test_vouchers.py +++ b/src/tests/control/test_vouchers.py @@ -93,9 +93,9 @@ class VoucherFormTest(SoupTestMixin, TransactionTestCase): doc = self.client.get('/control/event/%s/%s/vouchers/?download=yes' % (self.orga.slug, self.event.slug)) assert doc.content.decode().strip() == '"Voucher code","Valid until","Product","Reserve quota",' \ '"Bypass quota","Price effect","Value","Tag","Redeemed",' \ - '"Maximum usages","Seat"' \ + '"Maximum usages","Seat","Comment"' \ '\r\n"ABCDEFG","","Early-bird ticket","No","No","No effect","","","0",' \ - '"1",""' + '"1","",""' def test_filter_status_valid(self): with scopes_disabled():