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:
|
||||
return delete_from_trade(lot, ids)
|
||||
|
||||
if not g.user in lot.owner:
|
||||
txt = 'This is not your trade'
|
||||
# import pdb; pdb.set_trace()
|
||||
if not g.user == lot.owner:
|
||||
txt = 'This is not your lot'
|
||||
raise ma.ValidationError(txt)
|
||||
|
||||
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)
|
||||
|
||||
|
|
Reference in a new issue