mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 04:54:18 +00:00
🧹 Cleanup filter conditions
This commit is contained in:
parent
28979d7f8a
commit
400909feb8
1 changed files with 2 additions and 2 deletions
|
@ -20,10 +20,10 @@ def page_repositories():
|
||||||
spectator = Authorization.query.filter_by(email=user.email).join(Repository)
|
spectator = Authorization.query.filter_by(email=user.email).join(Repository)
|
||||||
if request.json.get("onlyActive"):
|
if request.json.get("onlyActive"):
|
||||||
owner = owner.filter_by(isActive=True)
|
owner = owner.filter_by(isActive=True)
|
||||||
spectator = spectator.filter(Repository.isActive == True)
|
spectator = spectator.filter(Repository.isActive)
|
||||||
elif request.json.get("onlyDead"):
|
elif request.json.get("onlyDead"):
|
||||||
owner = owner.filter_by(isActive=False)
|
owner = owner.filter_by(isActive=False)
|
||||||
spectator = spectator.filter(Repository.isActive == False)
|
spectator = spectator.filter(not Repository.isActive)
|
||||||
owner = owner.all()
|
owner = owner.all()
|
||||||
spectator = spectator.all()
|
spectator = spectator.all()
|
||||||
return json_success({"owner": [r.to_json() for r in owner],
|
return json_success({"owner": [r.to_json() for r in owner],
|
||||||
|
|
Loading…
Reference in a new issue