From c03d872d91e303031ba6dd069cb8ebd6206454a8 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 2 Dec 2020 13:15:21 +0100 Subject: [PATCH] fixed bug hid == None --- ereuse_devicehub/resources/action/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/action/views.py b/ereuse_devicehub/resources/action/views.py index 86ca07df..e3dbc8fd 100644 --- a/ereuse_devicehub/resources/action/views.py +++ b/ereuse_devicehub/resources/action/views.py @@ -216,7 +216,7 @@ class ActionView(View): device = snapshot.get('device') # type: Computer # TODO @cayop dependency of pulls 85 and 83 # if the pr/85 and pr/83 is merged, then you need change this way for get the device - if not Device.query.filter(Device.hid==device.hid).count(): + if not device.hid or not Device.query.filter(Device.hid==device.hid).count(): return device = Device.query.filter(Device.hid==device.hid).one()