Fixed cache issue, added carpool support to orders
This commit is contained in:
parent
75fd737baa
commit
4295ff39e0
8
ext.py
8
ext.py
|
@ -65,6 +65,7 @@ class Order:
|
|||
self.is_fursuiter = True if self.ans('is_fursuiter') != 'No' else False
|
||||
self.is_allergic = True if self.ans('is_allergic') != 'No' else False
|
||||
self.propic_locked = self.ans('propic_locked')
|
||||
self.carpooling_message = json.loads(self.ans('carpooling_message')) if self.ans('carpooling_message') else {}
|
||||
self.birth_date = self.ans('birth_date')
|
||||
self.name = self.ans('fursona_name')
|
||||
self.room_id = self.ans('room_id')
|
||||
|
@ -186,7 +187,9 @@ class OrderManager:
|
|||
data = res.json()
|
||||
for o in data['results']:
|
||||
o = Order(o)
|
||||
if o.status in ['canceled', 'expired']: continue
|
||||
if o.status in ['canceled', 'expired']:
|
||||
self.remove_cache(order)
|
||||
else:
|
||||
self.add_cache(Order(o))
|
||||
|
||||
# If a cached order is needed, just get it if available
|
||||
|
@ -214,9 +217,10 @@ class OrderManager:
|
|||
|
||||
order = Order(res)
|
||||
if order.status in ['canceled', 'expired']:
|
||||
self.remove_cache(order)
|
||||
if request:
|
||||
raise exceptions.Forbidden(f"Your order has been deleted. Contact support with your order identifier ({res['code']}) for further info.")
|
||||
|
||||
else:
|
||||
self.add_cache(order)
|
||||
|
||||
if request and secret != res['secret']:
|
||||
|
|
Loading…
Reference in New Issue