소스 검색

Remove trailing colon on empty evalMatches

master
JustAnotherArchivist 3 년 전
부모
커밋
e4946a6b3c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      contrib/modules/grafana.py

+ 1
- 1
contrib/modules/grafana.py 파일 보기

@@ -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:


불러오는 중...
취소
저장