From 400909feb83b36dfb974ec54722a1a6906e73b04 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi <256895@studenti.unimore.it> Date: Fri, 30 Apr 2021 15:46:53 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Cleanup=20filter=20conditions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/backend/nest_backend/routes/repository/repositories.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/backend/nest_backend/routes/repository/repositories.py b/code/backend/nest_backend/routes/repository/repositories.py index d58edf4..1ac019b 100644 --- a/code/backend/nest_backend/routes/repository/repositories.py +++ b/code/backend/nest_backend/routes/repository/repositories.py @@ -20,10 +20,10 @@ def page_repositories(): spectator = Authorization.query.filter_by(email=user.email).join(Repository) if request.json.get("onlyActive"): owner = owner.filter_by(isActive=True) - spectator = spectator.filter(Repository.isActive == True) + spectator = spectator.filter(Repository.isActive) elif request.json.get("onlyDead"): owner = owner.filter_by(isActive=False) - spectator = spectator.filter(Repository.isActive == False) + spectator = spectator.filter(not Repository.isActive) owner = owner.all() spectator = spectator.all() return json_success({"owner": [r.to_json() for r in owner],