Merge branch 'develop' into fix/user-role-err
This commit is contained in:
commit
d439c081fc
|
|
@ -34,7 +34,7 @@ class CheckWhetherBookingAvailable(generics.GenericAPIView):
|
|||
periods = response['periods']
|
||||
periods_by_name = {period['period']: period for period in periods if 'period' in period}
|
||||
if not periods_by_name:
|
||||
raise ValueError('Empty guestonline response')
|
||||
return None
|
||||
|
||||
period_template = iter(periods_by_name.values()).__next__().copy()
|
||||
period_template.pop('total_left_seats')
|
||||
|
|
@ -86,6 +86,8 @@ class CheckWhetherBookingAvailable(generics.GenericAPIView):
|
|||
if establishment.guestonline_id is not None \
|
||||
else service.response if service else None
|
||||
response.update({'details': service_response})
|
||||
if service_response is None:
|
||||
response['available'] = False
|
||||
return Response(data=response, status=200)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user