Allow spaces in signal name
This commit is contained in:
parent
3b3faecdf1
commit
6a549f3fd7
|
@ -90,8 +90,14 @@ class HookAPI(APIView):
|
|||
|
||||
# Try getting the signal
|
||||
# AUCAD 3M Stoch Exit: C$2419.64 at OANDA
|
||||
message_first_half = hook_resp.message.split(":")[0]
|
||||
signal_name = message_first_half.split(" ")[-1]
|
||||
# >>> a.split(":")[0:]
|
||||
# ['AUCAD 3M Stoch Exit', ' C$2419.64 at OANDA']
|
||||
# >>> a.split(":")[0].split(" ")[2:]
|
||||
# ['Stoch', 'Exit']
|
||||
# >>> " ".join(a.split(":")[0].split(" ")[2:])
|
||||
# 'Stoch Exit'
|
||||
|
||||
signal_name = " ".join(hook_resp.message.split(":")[0].split(" ")[2:])
|
||||
try:
|
||||
signal = Signal.objects.get(signal=signal_name)
|
||||
except Signal.DoesNotExist:
|
||||
|
|
Loading…
Reference in New Issue