Skip to content

Commit

Permalink
skip over chunks that result in 400 client error responses
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveagent57 committed Mar 22, 2024
1 parent 8d9739c commit 0710b29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/local_assignment_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,13 @@ def request_assignments(subscription_plan_uuid, chunk_id, emails_for_chunk, envi
response.raise_for_status()
except requests.exceptions.HTTPError:
# if it's a 401, try refetching the JWT and re-try the request
print(response.content)
if response.status_code == 401:
print('EXPIRED JWT, REFETCHING...')
response = _post_assignments(subscription_plan_uuid, emails_for_chunk, environment, fetch_jwt)
response.raise_for_status()
else:
raise
print('Continuing past this exception.')

response_data = response.json()

Expand Down

0 comments on commit 0710b29

Please sign in to comment.