fixing remove decvices from a temporary lot
This commit is contained in:
parent
0f744d5eb7
commit
c0558733ec
|
@ -255,11 +255,13 @@ class LotDeviceView(LotBaseChildrenView):
|
||||||
if lot.trade:
|
if lot.trade:
|
||||||
return delete_from_trade(lot, ids)
|
return delete_from_trade(lot, ids)
|
||||||
|
|
||||||
if not g.user in lot.owner:
|
# import pdb; pdb.set_trace()
|
||||||
txt = 'This is not your trade'
|
if not g.user == lot.owner:
|
||||||
|
txt = 'This is not your lot'
|
||||||
raise ma.ValidationError(txt)
|
raise ma.ValidationError(txt)
|
||||||
|
|
||||||
devices = set(Device.query.filter(Device.id.in_(ids)).filter(
|
devices = set(Device.query.filter(Device.id.in_(ids)).filter(
|
||||||
Device.owner_id.in_(g.user.id)))
|
Device.owner_id == g.user.id))
|
||||||
|
|
||||||
lot.devices.difference_update(devices)
|
lot.devices.difference_update(devices)
|
||||||
|
|
||||||
|
|
Reference in New Issue