|
|
@ -92,7 +92,7 @@ class Check(models.Model): |
|
|
|
self.channel_set.add(*channels) |
|
|
|
|
|
|
|
def tags_list(self): |
|
|
|
return self.tags.split(" ") |
|
|
|
return [t.strip() for t in self.tags.split(" ") if t.strip()] |
|
|
|
|
|
|
|
|
|
|
|
class Ping(models.Model): |
|
|
@ -148,14 +148,9 @@ class Channel(models.Model): |
|
|
|
|
|
|
|
n.save() |
|
|
|
elif self.kind == "slack": |
|
|
|
tmpl = "integrations/slack_message.html" |
|
|
|
tmpl = "integrations/slack_message.json" |
|
|
|
text = render_to_string(tmpl, {"check": check}) |
|
|
|
payload = { |
|
|
|
"text": text, |
|
|
|
"username": "healthchecks.io", |
|
|
|
"icon_url": "https://healthchecks.io/static/img/[email protected]" |
|
|
|
} |
|
|
|
|
|
|
|
payload = json.loads(text) |
|
|
|
r = requests.post(self.value, json=payload, timeout=5) |
|
|
|
|
|
|
|
n.status = r.status_code |
|
|
|