Skip to content

Commit

Permalink
Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
shokada committed Feb 25, 2020
1 parent ffabb7b commit 9a55893
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions promgen/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import collections
import logging
import os
import json
from urllib.parse import urljoin

from atomicwrites import atomic_write
Expand All @@ -16,7 +15,7 @@
@shared_task
def index_alert(alert_pk):
alert = models.Alert.objects.get(pk=alert_pk)
labels = json.loads(alert.body)["commonLabels"]
labels = alert.json.get("commonLabels")
for name, value in labels.items():
models.AlertLabel.objects.create(alert=alert, name=name, value=value)

Expand Down

0 comments on commit 9a55893

Please sign in to comment.