From e326e8ccdf343e185b4131224d7f112caf323ac4 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 11 Nov 2021 22:21:58 +0100 Subject: [PATCH] fixing revoke when the device is in one future trade --- ereuse_devicehub/resources/lot/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ereuse_devicehub/resources/lot/views.py b/ereuse_devicehub/resources/lot/views.py index 6a7b7f79..961ab812 100644 --- a/ereuse_devicehub/resources/lot/views.py +++ b/ereuse_devicehub/resources/lot/views.py @@ -267,6 +267,12 @@ def delete_from_trade(lot: Lot, devices: List): txt = 'This is not your trade' raise ma.ValidationError(txt) + # we need lock the action revoke for devices than travel for futures trades + for dev in devices: + if dev.owner not in users: + txt = 'This is not your device' + raise ma.ValidationError(txt) + drop_of_lot = [] without_confirms = [] for dev in devices: