Some booking fixes
This commit is contained in:
parent
0b9fd8b1dc
commit
0816a847ac
|
|
@ -141,7 +141,7 @@ class LastableService(AbstractBookingService):
|
|||
super().check_whether_booking_available(restaurant_id, date)
|
||||
url = f'{self.url}v1/restaurant/{restaurant_id}/offers'
|
||||
r = requests.get(url, headers=self.get_common_headers(), proxies=self.proxies)
|
||||
response = json.loads(r.content)['data']
|
||||
response = json.loads(r.content).get('data')
|
||||
if not status.is_success(r.status_code) or not response:
|
||||
return False
|
||||
self.response = response
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ class CheckWhetherBookingAvailable(generics.GenericAPIView):
|
|||
|
||||
response = {
|
||||
'available': is_booking_available,
|
||||
'type': service.service,
|
||||
'type': service.service if service else None,
|
||||
}
|
||||
response.update({'details': service.response} if service.response else {})
|
||||
response.update({'details': service.response} if service and service.response else {})
|
||||
return Response(data=response, status=200)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user