distinct instead of set

This commit is contained in:
Cayo Puigdefabregas 2022-01-26 11:22:47 +01:00
parent e3f917a3ce
commit 36199a7ee1

View file

@ -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