diff --git a/hc/api/models.py b/hc/api/models.py index b27f352d..98aca553 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -116,7 +116,7 @@ class Check(models.Model): return str(self.code) def relative_url(self): - if self.project.show_slugs: + if self.project_id and self.project.show_slugs: if not self.slug: return None @@ -267,7 +267,7 @@ class Check(models.Model): update_rel_url = reverse("hc-api-single", args=[self.code]) pause_rel_url = reverse("hc-api-pause", args=[self.code]) - result["ping_url"] = self.url() + result["ping_url"] = settings.PING_ENDPOINT + str(self.code) result["update_url"] = settings.SITE_ROOT + update_rel_url result["pause_url"] = settings.SITE_ROOT + pause_rel_url result["channels"] = self.channels_str()