Get the right signal name from the callback and fix position close schema
This commit is contained in:
@@ -89,8 +89,11 @@ class HookAPI(APIView):
|
||||
return HttpResponseBadRequest("Hook does not exist.")
|
||||
|
||||
# Try getting the signal
|
||||
# AUCAD 3M StochExit: C$2419.64 at OANDA
|
||||
message_first_half = hook_resp.message.split(":")[0]
|
||||
signal_name = message_first_half.split(" ")[-1]
|
||||
try:
|
||||
signal = Signal.objects.get(signal=hook_resp.title)
|
||||
signal = Signal.objects.get(signal=signal_name)
|
||||
except Signal.DoesNotExist:
|
||||
return HttpResponseBadRequest("Signal does not exist.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user