fixed similar_one for get only from your devices

This commit is contained in:
Cayo Puigdefabregas 2020-11-06 17:09:39 +01:00
parent af9fe2d6b6
commit 52bd6d5271
1 changed files with 2 additions and 1 deletions

View File

@ -577,7 +577,8 @@ class Component(Device):
""" """
assert self.hid is None, 'Don\'t use this method with a component that has HID' assert self.hid is None, 'Don\'t use this method with a component that has HID'
component = self.__class__.query \ 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)) \ .filter(~Component.id.in_(blacklist)) \
.first() .first()
if not component: if not component: