Fix price extraction bug and remove debugging statements

This commit is contained in:
2023-08-26 11:05:28 +00:00
parent cd32dff779
commit e10c6f5c46
6 changed files with 10 additions and 25 deletions

View File

@@ -49,13 +49,11 @@ class HookAPI(APIView):
log.error(f"HookAPI POST: {e}")
return HttpResponseBadRequest(e)
if hasattr(hook_resp, "market.price"):
if hasattr(hook_resp, "price"):
try:
price = float(hook_resp.market.price)
price = float(hook_resp.price)
except ValueError:
log.debug(
f"Could not extract price from message: {hook_resp.market.price}"
)
log.debug(f"Could not extract price from message: {hook_resp.price}")
return HttpResponseBadRequest("Could not extract price from message")
else:
price = extract_price(hook_resp.message)