Parcourir la source

Remove trailing colon on empty evalMatches

master
JustAnotherArchivist il y a 3 ans
Parent
révision
e4946a6b3c
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. +1
    -1
      contrib/modules/grafana.py

+ 1
- 1
contrib/modules/grafana.py Voir le fichier

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

async def process(request):
obj = json.loads(await request.text())
evalMatchesStr = (': ' + ', '.join(f'{x["metric"]} = {x["value"]}' for x in obj['evalMatches'])) if 'evalMatches' in obj else ''
evalMatchesStr = (': ' + ', '.join(f'{x["metric"]} = {x["value"]}' for x in obj['evalMatches'])) if 'evalMatches' in obj and obj['evalMatches'] else ''
if 'message' in obj:
return f'{obj["title"]} - {obj["message"]}{evalMatchesStr}'
else:


Chargement…
Annuler
Enregistrer