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 c0b9cc1 commit 55ce1fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/tests/test_hotel.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_staffer_auth(mock_post, client):
]
}
]
mock_post.return_value.json = results.pop
mock_post.return_value.json = results.shift
rv = client.post('/api/uber/west2024/login', json={"token": "234"})
assert(rv.status_code == 200)

Expand Down Expand Up @@ -199,7 +199,7 @@ def test_staffer_auth(mock_post, client):
]
}
]
mock_post.return_value.json = results.pop
mock_post.return_value.json = results.shift
rv = client.post('/api/uber/west2024/login', json={"token": "123"})
assert(rv.status_code == 200)

Expand Down Expand Up @@ -272,7 +272,7 @@ def test_staffer_auth(mock_post, client):
]
}
]
mock_post.return_value.json = results.pop
mock_post.return_value.json = results.shift
rv = client.post('/api/uber/west2024/login', json={"token": "456"})
assert(rv.status_code != 200)

Expand Down
3 changes: 2 additions & 1 deletion backend/tuber/api/uber.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ def sync_attendees(event):
else:
print(f"Skipping attendee {attendee} since I couldn't find it in Uber")
continue
g.progress(idx / len(eligible), status=f"Checking attendee {uber_model['full_name']}")
if idx % 100 == 0:
g.progress(idx / len(eligible), status=f"Checking attendee {uber_model['full_name']}")
if attendee in badgelookup:
badge = badgelookup[attendee]
if uber_model['full_name'] != badge.public_name:
Expand Down

0 comments on commit 55ce1fd

Please sign in to comment.