From 79ef2ba396cfbed6f478ff31c8c5cff78f9802e4 Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Tue, 11 Jul 2023 17:07:14 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- findmyorder/main.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/findmyorder/main.py b/findmyorder/main.py index 46048c89..7ace469b 100644 --- a/findmyorder/main.py +++ b/findmyorder/main.py @@ -97,19 +97,19 @@ async def get_order( msg: str, ): """get an order.""" - if await self.search(msg): - order = await self.identify_order(msg) - if isinstance(order, dict): - order["timestamp"] = datetime.utcnow().strftime( - "%Y-%m-%dT%H:%M:%SZ") - print(settings.instrument_mapping) - if settings.instrument_mapping: - await self.replace_instrument(order) - if order["instrument"] in settings.ignore_instrument: - """ ignoring instrument""" - return - return order - return None + if not await self.search(msg): + return None + order = await self.identify_order(msg) + if isinstance(order, dict): + order["timestamp"] = datetime.utcnow().strftime( + "%Y-%m-%dT%H:%M:%SZ") + print(settings.instrument_mapping) + if settings.instrument_mapping: + await self.replace_instrument(order) + if order["instrument"] in settings.ignore_instrument: + """ ignoring instrument""" + return + return order async def replace_instrument(self, order): """ replace instrument by an alternative instrument """