forked from MarseyWorld/MarseyWorld
actually return an error instead
parent
f4066a57ac
commit
16abd74031
|
@ -26,7 +26,9 @@ def hats(v):
|
|||
hats = hats.filter(HatDef.submitter_id == None)
|
||||
|
||||
if sort and sort != "owners":
|
||||
if sort == "description":
|
||||
if sort == "name":
|
||||
key = HatDef.name
|
||||
elif sort == "description":
|
||||
key = HatDef.description
|
||||
elif sort == "author":
|
||||
key = User.username
|
||||
|
@ -35,7 +37,7 @@ def hats(v):
|
|||
elif sort == "added_on":
|
||||
key = HatDef.created_utc.desc()
|
||||
else:
|
||||
key = HatDef.name
|
||||
abort(400, "Invalid sort")
|
||||
|
||||
hats = hats.order_by(key).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
|
||||
elif sort == "owners":
|
||||
|
|
Loading…
Reference in New Issue