Fix price extraction bug and remove debugging statements
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user