fix(backend): reject is dumb
All checks were successful
Publish docker image / Publish (push) Successful in 1m47s
All checks were successful
Publish docker image / Publish (push) Successful in 1m47s
This commit is contained in:
parent
53f257bc4b
commit
b4634f2a36
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue