From aa8ee887d3f566b6e39fc8e2707220e75de65727 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 7 Dec 2022 07:20:05 +0000 Subject: [PATCH] Replace numbers with question marks in signal name --- core/views/hooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/views/hooks.py b/core/views/hooks.py index 379f40a..adb4fa0 100644 --- a/core/views/hooks.py +++ b/core/views/hooks.py @@ -1,4 +1,5 @@ import re +from string import digits import orjson from django.contrib.auth.mixins import LoginRequiredMixin @@ -98,6 +99,9 @@ class HookAPI(APIView): # 'Stoch Exit' signal_name = " ".join(hook_resp.message.split(":")[0].split(" ")[2:]) + for x in signal_name: + if x in digits: + signal_name = signal_name.replace(x, "?") try: signal = Signal.objects.get(signal=signal_name) except Signal.DoesNotExist: