refactor return bool
This commit is contained in:
parent
36199a7ee1
commit
2e613265a6
|
@ -36,10 +36,7 @@ class LotDeviceForm(FlaskForm):
|
||||||
self._devices = Device.query.filter(Device.id.in_(devices)).filter(
|
self._devices = Device.query.filter(Device.id.in_(devices)).filter(
|
||||||
Device.owner_id == g.user.id).distinct().all()
|
Device.owner_id == g.user.id).distinct().all()
|
||||||
|
|
||||||
if not self._devices:
|
return bool(self._devices)
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
self._lot.devices.update(self._devices)
|
self._lot.devices.update(self._devices)
|
||||||
|
|
Reference in New Issue