From 360723f76179af48c10508a6c349ccb44641975e Mon Sep 17 00:00:00 2001 From: justcool393 Date: Sat, 8 Oct 2022 10:53:54 -0700 Subject: [PATCH] num hats fix (and pct fix too?) --- files/routes/users.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/users.py b/files/routes/users.py index c90fc2dd2..3ee41a2b9 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -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"):