Bugfix sorting user table
This commit is contained in:
parent
49692b4a45
commit
d80297e1a8
|
@ -298,10 +298,13 @@ def list_users():
|
||||||
limit = int(request.args.get("limit") or 10)
|
limit = int(request.args.get("limit") or 10)
|
||||||
search = request.args.get("search")
|
search = request.args.get("search")
|
||||||
sort = request.args.get("sort", "id")
|
sort = request.args.get("sort", "id")
|
||||||
order = request.args.get("order", "").lower()
|
|
||||||
state = None
|
state = None
|
||||||
if sort == "state":
|
if sort == "state":
|
||||||
state = json.loads(request.args.get("state", "[]"))
|
state = json.loads(request.args.get("state", "[]"))
|
||||||
|
else:
|
||||||
|
if sort not in ub.User.__table__.columns.keys():
|
||||||
|
sort = "id"
|
||||||
|
order = request.args.get("order", "").lower()
|
||||||
|
|
||||||
if sort != "state" and order:
|
if sort != "state" and order:
|
||||||
order = text(sort + " " + order)
|
order = text(sort + " " + order)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user