Skip to content

Commit

Permalink
Fixing uber result parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbyt3r committed Oct 16, 2024
1 parent bb731a4 commit c0b9cc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ COPY pyproject.toml pyproject.toml
# pip3 install lupa==1.14.1 --global-option="--with-cython"


COPY tuber tuber
RUN pip install .
COPY tuber tuber

ENV DATABASE_URL=sqlite:///database.db
ENV FLASK_DEBUG=false
Expand Down
6 changes: 2 additions & 4 deletions backend/tuber/api/uber.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,8 @@ def staffer_auth(slug):
headers = {
'X-Auth-Token': event_obj.uber_apikey
}
results = requests.post(event_obj.uber_url, headers=headers, json=req).json()['results']
if len(results) == 0:
return "no result", 403
result = results[0]['result']['attendees']
results = requests.post(event_obj.uber_url, headers=headers, json=req).json()['result']
result = results['attendees']
if len(result) == 0:
return "no attendee found", 403
if len(result) > 1:
Expand Down

0 comments on commit c0b9cc1

Please sign in to comment.