diff --git a/ext.py b/ext.py index 903ef7b..2b4a345 100644 --- a/ext.py +++ b/ext.py @@ -29,17 +29,21 @@ class Order: self.has_late = False self.first_name = None self.last_name = None - self.country = None + self.country = 'xx' self.address = None 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']: if p['item'] in ITEM_IDS['ticket']: self.position_id = p['id'] self.position_positionid = p['positionid'] self.answers = p['answers'] self.barcode = p['secret'] - self.address = f"{p['street']} - {p['zipcode']} {p['city']} - {p['country']}" self.checked_in = bool(p['checkins']) if p['item'] in ITEM_IDS['membership_card']: @@ -48,9 +52,6 @@ class Order: if p['item'] in ITEM_IDS['sponsorship']: self.sponsorship = 'normal' if p['variation'] == ITEMS_IDS['sponsorship'][0] else 'super' - if p['country']: - self.country = p['country'] - if p['attendee_name']: self.first_name = p['attendee_name_parts']['given_name'] self.last_name = p['attendee_name_parts']['family_name']