Last active
November 15, 2019 15:27
-
-
Save okomarov/66eed2fc2657e9d1ca2effb6f55ad4b3 to your computer and use it in GitHub Desktop.
Get waitlist position
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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