Browse Source

Handle message-less Grafana alerts

master
JustAnotherArchivist 3 years ago
parent
commit
c2803274d1
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      contrib/modules/grafana.py

+ 4
- 1
contrib/modules/grafana.py View File

@@ -3,4 +3,7 @@ import json

async def process(request):
obj = json.loads(await request.text())
return f'{obj["title"]} - {obj["message"]}'
if 'message' in obj:
return f'{obj["title"]} - {obj["message"]}'
else:
return obj['title']

Loading…
Cancel
Save