fix(backend): temporarily disable reject proxy as it is broken
All checks were successful
Publish docker image / Publish (push) Successful in 18m35s
All checks were successful
Publish docker image / Publish (push) Successful in 18m35s
This commit is contained in:
parent
0d36c80bc5
commit
cec119c548
1 changed files with 22 additions and 22 deletions
|
@ -20,28 +20,28 @@ def make_client_session():
|
||||||
@router.get('/reject')
|
@router.get('/reject')
|
||||||
async def reject_proxy(date: str, time: str, activity: str, space: str):
|
async def reject_proxy(date: str, time: str, activity: str, space: str):
|
||||||
"""We proxy the rejectdopamine API to maintain user pivacy (the extension does not transmit user IP addresses to third-party services)"""
|
"""We proxy the rejectdopamine API to maintain user pivacy (the extension does not transmit user IP addresses to third-party services)"""
|
||||||
async with make_client_session() as session:
|
# async with make_client_session() as session:
|
||||||
async with session.get('https://rejectdopamine.com/api/app/active/yrk/cs/1') as resp:
|
# async with session.get('https://rejectdopamine.com/api/app/active/yrk/cs/1') as resp:
|
||||||
response = await resp.json()
|
# response = await resp.json()
|
||||||
activities = []
|
# activities = []
|
||||||
if 'sessions' not in response:
|
# if 'sessions' not in response:
|
||||||
return {
|
# return {
|
||||||
'date': date,
|
# 'date': date,
|
||||||
'time': time,
|
# 'time': time,
|
||||||
'space': space,
|
# 'space': space,
|
||||||
'activity': activity,
|
# 'activity': activity,
|
||||||
'codes': [],
|
# 'codes': [],
|
||||||
}
|
# }
|
||||||
for session in response['sessions']:
|
# for session in response['sessions']:
|
||||||
if reformat_reject_date(session['startDate']) == date and time == f'{session["startTime"]} - {session["endTime"]}' and session['location'] in space:
|
# 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
|
# # Likely a correct result, let's return it
|
||||||
return {
|
# return {
|
||||||
'date': date,
|
# 'date': date,
|
||||||
'time': time,
|
# 'time': time,
|
||||||
'space': space,
|
# 'space': space,
|
||||||
'activity': activity,
|
# 'activity': activity,
|
||||||
'codes': list(map(lambda c: {'code': f'{c["checkinCode"]:06}', 'score': 0}, session['codes']))
|
# 'codes': list(map(lambda c: {'code': f'{c["checkinCode"]:06}', 'score': 0}, session['codes']))
|
||||||
}
|
# }
|
||||||
return {
|
return {
|
||||||
'date': date,
|
'date': date,
|
||||||
'time': time,
|
'time': time,
|
||||||
|
|
Loading…
Reference in a new issue