Skip to content

Commit

Permalink
AWAY, EVIL EXCEPTION
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Jan 13, 2024
1 parent 14ab4f9 commit de0821e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dojo_plugin/api/v1/belts.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def get_belts():
}

for n,(color,dojo_id) in enumerate(BELT_REQUIREMENTS.items()):
result["dates"][color] = {}
try:
dojo = Dojos.query.filter_by(id=dojo_id).first()
except sqlalchemy.exc.NoResultsFound:
dojo = Dojos.query.filter_by(id=dojo_id).first()
if not dojo:
# We are likely missing the correct dojos in the DB (e.g., custom deployment)
break

result["dates"][color] = {}

for user,date in dojo.completions():
if result["users"].get(user.id, {"rank_id":-1})["rank_id"] != n-1:
continue
Expand Down

0 comments on commit de0821e

Please sign in to comment.