num hats fix (and pct fix too?)

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-08 10:53:54 -07:00
parent 4baf7cfa42
commit 360723f761
1 changed files with 2 additions and 2 deletions

View File

@ -996,8 +996,8 @@ def u_username(username, v=None):
# this is probably totalllly inefficient but maybe someone can fix it later
total_num_of_hats = g.db.query(HatDef).filter(HatDef.submitter_id == None).count()
owned_hats = len(u.owned_hats)
owned_hats_pct = f'{owned_hats / total_num_of_hats:.0%}'
owned_hats = u.num_of_owned_hats
owned_hats_pct = f'{float(owned_hats) / total_num_of_hats:.0%}'
if u.unban_utc:
if request.headers.get("Authorization") or request.path.endswith(".json"):