From 52bd6d5271db0176ad948a66f7fdaaed411f3415 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 6 Nov 2020 17:09:39 +0100 Subject: [PATCH] fixed similar_one for get only from your devices --- ereuse_devicehub/resources/device/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index ac4cddf4..8fb9acdf 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -577,7 +577,8 @@ class Component(Device): """ assert self.hid is None, 'Don\'t use this method with a component that has HID' component = self.__class__.query \ - .filter_by(parent=parent, hid=None, **self.physical_properties) \ + .filter_by(parent=parent, hid=None, owner_id=self.owner_id, + **self.physical_properties) \ .filter(~Component.id.in_(blacklist)) \ .first() if not component: