1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-21 20:44:18 +00:00

🐛 GET requests can't have bodies

This commit is contained in:
Stefano Pigozzi 2021-04-30 15:48:05 +02:00
parent 400909feb8
commit 4803a8db59
Signed by untrusted user who does not match committer: steffo
GPG key ID: 6965406171929D01

View file

@ -18,10 +18,10 @@ def page_repositories():
if request.method == "GET":
owner = Repository.query.filter_by(owner_id=user.email)
spectator = Authorization.query.filter_by(email=user.email).join(Repository)
if request.json.get("onlyActive"):
if request.args.get("onlyActive"):
owner = owner.filter_by(isActive=True)
spectator = spectator.filter(Repository.isActive)
elif request.json.get("onlyDead"):
elif request.args.get("onlyDead"):
owner = owner.filter_by(isActive=False)
spectator = spectator.filter(not Repository.isActive)
owner = owner.all()