Enhanced delete_lock() function

Enhanced the complexity of delete_lock() function.
This commit is contained in:
Hicham Berbache 2023-01-03 15:07:09 +01:00 committed by GitHub
parent 91d8370909
commit f593036a10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,11 @@ class FtRestClient():
:param lock_id: ID for the lock to delete :param lock_id: ID for the lock to delete
:return: json object :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): def daily(self, days=None):
"""Return the profits for each day, and amount of trades. """Return the profits for each day, and amount of trades.