From 30f511a03afaeaf669f8592be0cfcd39304df00a Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 29 Aug 2022 16:36:57 +0200 Subject: [PATCH] add both device in a public page when is a twin device --- ereuse_devicehub/resources/device/views.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ereuse_devicehub/resources/device/views.py b/ereuse_devicehub/resources/device/views.py index 1fff5bcc..2729592a 100644 --- a/ereuse_devicehub/resources/device/views.py +++ b/ereuse_devicehub/resources/device/views.py @@ -110,9 +110,7 @@ class DeviceView(View): return super().get(id) def patch(self, id): - dev = Device.query.filter_by( - id=id, owner_id=g.user.id, active=True - ).one() + dev = Device.query.filter_by(id=id, owner_id=g.user.id, active=True).one() if isinstance(dev, Computer): resource_def = app.resources['Computer'] # TODO check how to handle the 'actions_one' @@ -138,13 +136,13 @@ class DeviceView(View): return self.one_private(id) def one_public(self, id: int): - device = Device.query.filter_by( - devicehub_id=id, active=True - ).one() + device = Device.query.filter_by(devicehub_id=id, active=True).one() abstract = None if device.is_abstract() == 'Twin': abstract = device.placeholder.binding - return render_template('devices/layout.html', device=device, states=states, abstract=abstract) + return render_template( + 'devices/layout.html', device=device, states=states, abstract=abstract + ) @auth.Auth.requires_auth def one_private(self, id: str):