diff --git a/files/routes/hats.py b/files/routes/hats.py index 151bfd84c..b6b2f83cf 100644 --- a/files/routes/hats.py +++ b/files/routes/hats.py @@ -11,8 +11,8 @@ def hats(v): if not FEATURES['HATS']: abort(404) owned_hats = [x[0] for x in g.db.query(Hat.hat_id).filter_by(user_id=v.id).all()] - owned = g.db.query(HatDef, User).join(HatDef.author).filter(HatDef.id.in_(owned_hats)).order_by(HatDef.price).all() - not_owned = g.db.query(HatDef, User).join(HatDef.author).filter(HatDef.id.notin_(owned_hats)).order_by(HatDef.price).all() + owned = g.db.query(HatDef, User).join(HatDef.author).filter(HatDef.id.in_(owned_hats)).order_by(HatDef.price, HatDef.name).all() + not_owned = g.db.query(HatDef, User).join(HatDef.author).filter(HatDef.id.notin_(owned_hats)).order_by(HatDef.price, HatDef.name).all() return render_template("hats.html", owned=owned, not_owned=not_owned, v=v)