Add a voucher’s comment to voucher.csv download (#1926)

This commit is contained in:
Richard Schreiber
2021-02-15 13:41:44 +01:00
committed by GitHub
parent 4db0530c09
commit f2a18325b6
2 changed files with 6 additions and 4 deletions

View File

@@ -67,7 +67,8 @@ class VoucherList(PaginationMixin, EventPermissionRequiredMixin, ListView):
headers = [ headers = [
_('Voucher code'), _('Valid until'), _('Product'), _('Reserve quota'), _('Bypass quota'), _('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) writer.writerow(headers)
@@ -92,7 +93,8 @@ class VoucherList(PaginationMixin, EventPermissionRequiredMixin, ListView):
v.tag, v.tag,
str(v.redeemed), str(v.redeemed),
str(v.max_usages), 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) writer.writerow(row)

View File

@@ -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)) 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",' \ assert doc.content.decode().strip() == '"Voucher code","Valid until","Product","Reserve quota",' \
'"Bypass quota","Price effect","Value","Tag","Redeemed",' \ '"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",' \ '\r\n"ABCDEFG","","Early-bird ticket","No","No","No effect","","","0",' \
'"1",""' '"1","",""'
def test_filter_status_valid(self): def test_filter_status_valid(self):
with scopes_disabled(): with scopes_disabled():