fix 500 error

master
Aevann 2024-01-20 09:01:40 +02:00
parent 74cc7e40ce
commit f4066a57ac
1 changed files with 3 additions and 3 deletions

View File

@ -26,9 +26,7 @@ def hats(v):
hats = hats.filter(HatDef.submitter_id == None)
if sort and sort != "owners":
if sort == "name":
key = HatDef.name
elif sort == "description":
if sort == "description":
key = HatDef.description
elif sort == "author":
key = User.username
@ -36,6 +34,8 @@ def hats(v):
key = HatDef.price
elif sort == "added_on":
key = HatDef.created_utc.desc()
else:
key = HatDef.name
hats = hats.order_by(key).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
elif sort == "owners":