Updated json schema for latest pretix version

This commit is contained in:
Ed 2023-08-06 12:46:09 +02:00
parent cb89641d05
commit fc864fce57
1 changed files with 6 additions and 5 deletions

11
ext.py
View File

@ -29,17 +29,21 @@ class Order:
self.has_late = False self.has_late = False
self.first_name = None self.first_name = None
self.last_name = None self.last_name = None
self.country = None self.country = 'xx'
self.address = None self.address = None
self.checked_in = False self.checked_in = False
idata = data['invoice_address']
if idata:
self.address = f"{idata['street']} - {idata['zipcode']} {idata['city']} - {idata['country']}"
self.country = idata['country']
for p in self.data['positions']: for p in self.data['positions']:
if p['item'] in ITEM_IDS['ticket']: if p['item'] in ITEM_IDS['ticket']:
self.position_id = p['id'] self.position_id = p['id']
self.position_positionid = p['positionid'] self.position_positionid = p['positionid']
self.answers = p['answers'] self.answers = p['answers']
self.barcode = p['secret'] self.barcode = p['secret']
self.address = f"{p['street']} - {p['zipcode']} {p['city']} - {p['country']}"
self.checked_in = bool(p['checkins']) self.checked_in = bool(p['checkins'])
if p['item'] in ITEM_IDS['membership_card']: if p['item'] in ITEM_IDS['membership_card']:
@ -48,9 +52,6 @@ class Order:
if p['item'] in ITEM_IDS['sponsorship']: if p['item'] in ITEM_IDS['sponsorship']:
self.sponsorship = 'normal' if p['variation'] == ITEMS_IDS['sponsorship'][0] else 'super' self.sponsorship = 'normal' if p['variation'] == ITEMS_IDS['sponsorship'][0] else 'super'
if p['country']:
self.country = p['country']
if p['attendee_name']: if p['attendee_name']:
self.first_name = p['attendee_name_parts']['given_name'] self.first_name = p['attendee_name_parts']['given_name']
self.last_name = p['attendee_name_parts']['family_name'] self.last_name = p['attendee_name_parts']['family_name']