Skip to content

Instantly share code, notes, and snippets.

@okomarov
Last active November 15, 2019 15:27
Show Gist options
  • Save okomarov/66eed2fc2657e9d1ca2effb6f55ad4b3 to your computer and use it in GitHub Desktop.
Save okomarov/66eed2fc2657e9d1ca2effb6f55ad4b3 to your computer and use it in GitHub Desktop.
Get waitlist position
def get_waitlist_position(uuid):
waitlist_user = get_waitlist_user(uuid)
score = waitlist_user.score
users_ahead = Waitlist.query.filter(Waitlist.score <= score).count()
return max(score, users_ahead)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment