diff --git a/src/pretix/plugins/checkinlists/exporters.py b/src/pretix/plugins/checkinlists/exporters.py index f046c0613..408b26a31 100644 --- a/src/pretix/plugins/checkinlists/exporters.py +++ b/src/pretix/plugins/checkinlists/exporters.py @@ -427,6 +427,11 @@ class CSVCheckinList(CheckInListMixin, ListExporter): headers.append(_('Order date')) headers.append(_('Requires special attention')) headers.append(_('Comment')) + headers.append(_('Seat ID')) + headers.append(_('Seat name')) + headers.append(_('Seat zone')) + headers.append(_('Seat row')) + headers.append(_('Seat number')) yield headers for op in qs: @@ -511,6 +516,18 @@ class CSVCheckinList(CheckInListMixin, ListExporter): row.append(op.order.datetime.astimezone(self.event.timezone).strftime('%Y-%m-%d')) row.append(_('Yes') if op.order.checkin_attention or op.item.checkin_attention else _('No')) row.append(op.order.comment or "") + + if op.seat: + row += [ + op.seat.seat_guid, + str(op.seat), + op.seat.zone_name, + op.seat.row_name, + op.seat.seat_number, + ] + else: + row += ['', '', '', '', ''] + yield row def get_filename(self): diff --git a/src/tests/plugins/test_checkinlist.py b/src/tests/plugins/test_checkinlist.py index 290ae6828..13b834426 100644 --- a/src/tests/plugins/test_checkinlist.py +++ b/src/tests/plugins/test_checkinlist.py @@ -69,11 +69,12 @@ def test_csv_simple(event): }) assert clean(content.decode()) == clean(""""Order code","Attendee name","Attendee name: Title","Attendee name: First name","Attendee name: Middle name","Attendee name: Family name","Product","Price","Checked in","Checked out","Automatically - checked in","Secret","E-mail","Company","Voucher code","Order date","Requires special attention","Comment" + checked in","Secret","E-mail","Company","Voucher code","Order date","Requires special attention","Comment","Seat ID","Seat name", +"Seat zone","Seat row","Seat number" "FOO","Mr Peter A Jones","Mr","Peter","A","Jones","Ticket","23.00","","","No","hutjztuxhkbtwnesv2suqv26k6ttytxx", -"dummy@dummy.test","","","2019-02-22","No","" +"dummy@dummy.test","","","2019-02-22","No","","","","","","" "FOO","Mrs Andrea J Zulu","Mrs","Andrea","J","Zulu","Ticket","13.00","","","No","ggsngqtnmhx74jswjngw3fk8pfwz2a7k", -"dummy@dummy.test","","","2019-02-22","No","" +"dummy@dummy.test","","","2019-02-22","No","","","","","","" """) @@ -93,11 +94,11 @@ def test_csv_order_by_name_parts(event): # noqa assert clean(content.decode()) == clean(""""Order code","Attendee name","Attendee name: Title", "Attendee name: First name","Attendee name: Middle name","Attendee name: Family name","Product","Price", "Checked in","Checked out","Automatically checked in","Secret","E-mail","Company","Voucher code","Order date","Requires special - attention","Comment" + attention","Comment","Seat ID","Seat name","Seat zone","Seat row","Seat number" "FOO","Mrs Andrea J Zulu","Mrs","Andrea","J","Zulu","Ticket","13.00","","","No","ggsngqtnmhx74jswjngw3fk8pfwz2a7k", -"dummy@dummy.test","","","2019-02-22","No","" +"dummy@dummy.test","","","2019-02-22","No","","","","","","" "FOO","Mr Peter A Jones","Mr","Peter","A","Jones","Ticket","23.00","","","No","hutjztuxhkbtwnesv2suqv26k6ttytxx", -"dummy@dummy.test","","","2019-02-22","No","" +"dummy@dummy.test","","","2019-02-22","No","","","","","","" """) c = CSVCheckinList(event) _, _, content = c.render({ @@ -110,11 +111,11 @@ def test_csv_order_by_name_parts(event): # noqa assert clean(content.decode()) == clean(""""Order code","Attendee name","Attendee name: Title", "Attendee name: First name","Attendee name: Middle name","Attendee name: Family name","Product","Price", "Checked in","Checked out","Automatically checked in","Secret","E-mail","Company","Voucher code","Order date","Requires special - attention","Comment" + attention","Comment","Seat ID","Seat name","Seat zone","Seat row","Seat number" "FOO","Mr Peter A Jones","Mr","Peter","A","Jones","Ticket","23.00","","","No","hutjztuxhkbtwnesv2suqv26k6ttytxx", -"dummy@dummy.test","","","2019-02-22","No","" +"dummy@dummy.test","","","2019-02-22","No","","","","","","" "FOO","Mrs Andrea J Zulu","Mrs","Andrea","J","Zulu","Ticket","13.00","","","No","ggsngqtnmhx74jswjngw3fk8pfwz2a7k", -"dummy@dummy.test","","","2019-02-22","No","" +"dummy@dummy.test","","","2019-02-22","No","","","","","","" """) @@ -165,11 +166,11 @@ def test_csv_order_by_inherited_name_parts(event): # noqa assert clean(content.decode()) == clean(""""Order code","Attendee name","Attendee name: Title", "Attendee name: First name","Attendee name: Middle name","Attendee name: Family name","Product","Price", "Checked in","Checked out","Automatically checked in","Secret","E-mail","Company","Voucher code","Order date","Requires special - attention","Comment" + attention","Comment","Seat ID","Seat name","Seat zone","Seat row","Seat number" "BAR","Mr Albert J Zulu","Mr","Albert","J","Zulu","Ticket","23.00","","","No","hutjztuxhkbtwnesv2suqv26k6ttytyy", -"dummy@dummy.test","BARCORP","","2019-02-22","No","" +"dummy@dummy.test","BARCORP","","2019-02-22","No","","","","","","" "FOO","Mr Paul A Jones","Mr","Paul","A","Jones","Ticket","23.00","","","No","hutjztuxhkbtwnesv2suqv26k6ttytxx", -"dummy@dummy.test","FOOCORP","","2019-02-22","No","" +"dummy@dummy.test","FOOCORP","","2019-02-22","No","","","","","","" """) c = CSVCheckinList(event) _, _, content = c.render({ @@ -182,11 +183,11 @@ def test_csv_order_by_inherited_name_parts(event): # noqa assert clean(content.decode()) == clean(""""Order code","Attendee name","Attendee name: Title", "Attendee name: First name","Attendee name: Middle name","Attendee name: Family name","Product","Price", "Checked in","Checked out","Automatically checked in","Secret","E-mail","Company","Voucher code","Order date","Requires special - attention","Comment" + attention","Comment","Seat ID","Seat name","Seat zone","Seat row","Seat number" "BAR","Mr Albert J Zulu","Mr","Albert","J","Zulu","Ticket","23.00","","","No","hutjztuxhkbtwnesv2suqv26k6ttytyy", -"dummy@dummy.test","BARCORP","","2019-02-22","No","" +"dummy@dummy.test","BARCORP","","2019-02-22","No","","","","","","" "FOO","Mr Paul A Jones","Mr","Paul","A","Jones","Ticket","23.00","","","No","hutjztuxhkbtwnesv2suqv26k6ttytxx", -"dummy@dummy.test","FOOCORP","","2019-02-22","No","" +"dummy@dummy.test","FOOCORP","","2019-02-22","No","","","","","","" """) c = CSVCheckinList(event) _, _, content = c.render({ @@ -199,9 +200,9 @@ def test_csv_order_by_inherited_name_parts(event): # noqa assert clean(content.decode()) == clean(""""Order code","Attendee name","Attendee name: Title", "Attendee name: First name","Attendee name: Middle name","Attendee name: Family name","Product","Price", "Checked in","Checked out","Automatically checked in","Secret","E-mail","Company","Voucher code","Order date","Requires special - attention","Comment" + attention","Comment","Seat ID","Seat name","Seat zone","Seat row","Seat number" "FOO","Mr Paul A Jones","Mr","Paul","A","Jones","Ticket","23.00","","","No","hutjztuxhkbtwnesv2suqv26k6ttytxx", -"dummy@dummy.test","FOOCORP","","2019-02-22","No","" +"dummy@dummy.test","FOOCORP","","2019-02-22","No","","","","","","" "BAR","Mr Albert J Zulu","Mr","Albert","J","Zulu","Ticket","23.00","","","No","hutjztuxhkbtwnesv2suqv26k6ttytyy", -"dummy@dummy.test","BARCORP","","2019-02-22","No","" +"dummy@dummy.test","BARCORP","","2019-02-22","No","","","","","","" """)