def get_delivery_termina ls venue_id memcache_key deliveryTerminals_ r

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
def get_delivery_terminals(venue_id):
memcache_key = "deliveryTerminals_%s"
result = memcache.get(memcache_key)
if not result:
org_id = Venue.venue_by_id(venue_id).company_id
response = __get_request(org_id, '/deliverySettings/getDeliveryTerminals', {
'organization': venue_id
})
result = json.loads(response)['deliveryTerminals']
memcache.set(memcache_key, result, time=24*3600)
return result