mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-28 02:42:17 +00:00
Fix string index
This commit is contained in:
@@ -414,7 +414,7 @@ class RecieveForumWebhook(generic.View):
|
|||||||
if not hmac.compare_digest(request.headers.get('X-Discourse-Event-Signature'), computed):
|
if not hmac.compare_digest(request.headers.get('X-Discourse-Event-Signature'), computed):
|
||||||
return HttpResponseForbidden('Invalid signature header')
|
return HttpResponseForbidden('Invalid signature header')
|
||||||
body = simplejson.loads(request.body.decode('utf-8'))
|
body = simplejson.loads(request.body.decode('utf-8'))
|
||||||
event_id = int(body['topic']['title'][1:5]) # find the ID, force convert it to an int to eliminate leading zeros
|
event_id = int(body['topic']['title'][1:6]) # find the ID, force convert it to an int to eliminate leading zeros
|
||||||
event = models.Event.objects.filter(pk=event_id).first()
|
event = models.Event.objects.filter(pk=event_id).first()
|
||||||
if event:
|
if event:
|
||||||
event.forum_url = f"https://forum.nottinghamtec.co.uk/t/{body['topic']['slug']}"
|
event.forum_url = f"https://forum.nottinghamtec.co.uk/t/{body['topic']['slug']}"
|
||||||
|
|||||||
Reference in New Issue
Block a user