diff --git a/backend/aci/proxy.py b/backend/aci/proxy.py index 689ff83..4f6850c 100644 --- a/backend/aci/proxy.py +++ b/backend/aci/proxy.py @@ -21,6 +21,14 @@ async def reject_proxy(date: str, time: str, activity: str, space: str): async with session.get('https://rejectdopamine.com/api/app/active/yrk/cs/1') as resp: response = await resp.json() activities = [] + if 'sessions' not in response: + return { + 'date': date, + 'time': time, + 'space': space, + 'activity': activity, + 'codes': [], + } for session in response['sessions']: if reformat_reject_date(session['startDate']) == date and time == f'{session["startTime"]} - {session["endTime"]}' and session['location'] in space: # Likely a correct result, let's return it