Fix issue w/ Lastable service
This commit is contained in:
parent
3da57b72fc
commit
3f6aa21005
|
|
@ -141,9 +141,9 @@ 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)
|
||||
if not status.is_success(r.status_code):
|
||||
return False
|
||||
response = json.loads(r.content)['data']
|
||||
if not status.is_success(r.status_code) or not response:
|
||||
return False
|
||||
self.response = response
|
||||
return True
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ class CheckWhetherBookingAvailable(generics.GenericAPIView):
|
|||
date = request.query_params.get('date')
|
||||
g_service = GuestonlineService()
|
||||
l_service = LastableService()
|
||||
if not establishment.lastable_id is None and l_service \
|
||||
if (not establishment.lastable_id is None) and l_service \
|
||||
.check_whether_booking_available(establishment.lastable_id, date):
|
||||
is_booking_available = True
|
||||
service = l_service
|
||||
service.service_id = establishment.lastable_id
|
||||
elif not establishment.guestonline_id is None and g_service \
|
||||
elif (not establishment.guestonline_id is None) and g_service \
|
||||
.check_whether_booking_available(establishment.guestonline_id, date):
|
||||
is_booking_available = True
|
||||
service = g_service
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user