From 2e564862e825d2fa5e38a106efe7ed2419baaab5 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 6 Oct 2021 11:53:41 +0200 Subject: [PATCH] excluding when it is in one trade action --- ereuse_devicehub/resources/action/schemas.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/action/schemas.py b/ereuse_devicehub/resources/action/schemas.py index 3d8070a9..ad629da9 100644 --- a/ereuse_devicehub/resources/action/schemas.py +++ b/ereuse_devicehub/resources/action/schemas.py @@ -836,7 +836,8 @@ class Delete(ActionWithMultipleDevices): @post_load def deactivate_device(self, data): for dev in data['devices']: - dev.active = False + if dev.last_action_trading is None: + dev.active = False class Migrate(ActionWithMultipleDevices):