From 04c7e4b51850581b63c9e231c10c6f38845e2ff9 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Tue, 27 Jun 2023 01:06:34 +0100 Subject: [PATCH] Fix ommited json parsing wotsit --- RIGS/views/rigboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIGS/views/rigboard.py b/RIGS/views/rigboard.py index 6245425c..4a02d3fa 100644 --- a/RIGS/views/rigboard.py +++ b/RIGS/views/rigboard.py @@ -414,7 +414,7 @@ class RecieveForumWebhook(generic.View): if not hmac.compare_digest(request.headers.get('X-Discourse-Event-Signature'), computed): return HttpResponseForbidden('Invalid signature header') body = simplejson.loads(request.body.decode('utf-8')) - event_id = int(body['title'][1:5]) # find the ID, force convert it to an int to eliminate leading zeros + event_id = int(body['topic']['title'][1:5]) # find the ID, force convert it to an int to eliminate leading zeros event = models.Event.objects.filter(pk=event_id).first() if event: event.forum_url = "https://forum.nottinghamtec.co.uk/t/{}"