Skip to content

Commit

Permalink
Merge pull request #402 from ynput/fix-enroll-empty-response
Browse files Browse the repository at this point in the history
Handle empty response when returning cached 'nothing to do' from enroll
  • Loading branch information
martastain authored Oct 24, 2024
2 parents 3fc4ae0 + 6751dc9 commit 206d65c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/events/enroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ def sloth(*args):

sloth("Request is already completed. Returning the cached result.")
await Redis.delete("enroll", request_hash)
return cached_result.get("result")
if result := cached_result.get("result"):
return EnrollResponseModel(**result)
return EmptyResponse() # return empty response if there is no result

else:
if cached_result:
Expand Down

0 comments on commit 206d65c

Please sign in to comment.