From a2b9d1c96dd3f5c16acd333d2f68bcdd50321525 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 20 Jul 2022 10:03:46 +0200 Subject: [PATCH] drop filter only by wb device --- ereuse_devicehub/resources/device/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/resources/device/views.py b/ereuse_devicehub/resources/device/views.py index 6412518c..238284e1 100644 --- a/ereuse_devicehub/resources/device/views.py +++ b/ereuse_devicehub/resources/device/views.py @@ -111,7 +111,7 @@ class DeviceView(View): def patch(self, id): dev = Device.query.filter_by( - id=id, owner_id=g.user.id, active=True, placeholder=None + id=id, owner_id=g.user.id, active=True ).one() if isinstance(dev, Computer): resource_def = app.resources['Computer'] @@ -139,14 +139,14 @@ class DeviceView(View): def one_public(self, id: int): device = Device.query.filter_by( - devicehub_id=id, active=True, placeholder=None + devicehub_id=id, active=True ).one() return render_template('devices/layout.html', device=device, states=states) @auth.Auth.requires_auth def one_private(self, id: str): device = Device.query.filter_by( - devicehub_id=id, owner_id=g.user.id, active=True, placeholder=None + devicehub_id=id, owner_id=g.user.id, active=True ).first() if not device: return self.one_public(id) @@ -176,7 +176,7 @@ class DeviceView(View): trades_dev_ids = {d.id for t in trades for d in t.devices} query = ( - Device.query.filter(Device.active == True, Device.placeholder == None) + Device.query.filter(Device.active == True) .filter((Device.owner_id == g.user.id) | (Device.id.in_(trades_dev_ids))) .distinct() )