From b4634f2a36afd806e5b1fe07ef1822073387ddfe Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Mon, 11 Mar 2024 11:09:22 +0000 Subject: [PATCH] fix(backend): reject is dumb --- backend/aci/proxy.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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