From 36199a7ee1042eb42d1d15b8e34c8b4797f2f953 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 26 Jan 2022 11:22:47 +0100 Subject: [PATCH] distinct instead of set --- ereuse_devicehub/inventory/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index 16c15b96..4b0a91c9 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -33,8 +33,8 @@ class LotDeviceForm(FlaskForm): Lot.owner_id == g.user.id).one() devices = set(self.devices.data.split(",")) - self._devices = set(Device.query.filter(Device.id.in_(devices)).filter( - Device.owner_id == g.user.id).all()) + self._devices = Device.query.filter(Device.id.in_(devices)).filter( + Device.owner_id == g.user.id).distinct().all() if not self._devices: return False