From f593036a10c35ae3543459d51b42fa3376b0935b Mon Sep 17 00:00:00 2001 From: Hicham Berbache <64667100+HichamBerbache@users.noreply.github.com> Date: Tue, 3 Jan 2023 15:07:09 +0100 Subject: [PATCH] Enhanced delete_lock() function Enhanced the complexity of delete_lock() function. --- scripts/rest_client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/rest_client.py b/scripts/rest_client.py index ac6d97133..999be0016 100755 --- a/scripts/rest_client.py +++ b/scripts/rest_client.py @@ -124,7 +124,11 @@ class FtRestClient(): :param lock_id: ID for the lock to delete :return: json object """ - return self._delete(f"locks/{lock_id}") + if not self.locks().get(lock_id): + logger.warning("Lock id not found!") + return None + else: + return self._delete(f"locks/{lock_id}") def daily(self, days=None): """Return the profits for each day, and amount of trades.