Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Jul 11, 2023
1 parent ea9b57f commit 79ef2ba
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions findmyorder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down

0 comments on commit 79ef2ba

Please sign in to comment.