Browse Source

Remove unused code

pull/563/head
Pēteris Caune 3 years ago
parent
commit
3e9e13104e
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 0 additions and 17 deletions
  1. +0
    -12
      hc/api/models.py
  2. +0
    -5
      hc/api/tests/test_channel_model.py

+ 0
- 12
hc/api/models.py View File

@ -650,12 +650,6 @@ class Channel(models.Model):
return self.json["service_key"]
@property
def pd_service_name(self):
assert self.kind == "pd"
if self.value.startswith("{"):
return self.json.get("name")
@property
def pd_account(self):
assert self.kind == "pd"
@ -733,17 +727,11 @@ class Channel(models.Model):
@property
def sms_notify_up(self):
assert self.kind == "sms"
if not self.value.startswith("{"):
return False
return self.json.get("up", False)
@property
def sms_notify_down(self):
assert self.kind == "sms"
if not self.value.startswith("{"):
return True
return self.json.get("down", True)
@property


+ 0
- 5
hc/api/tests/test_channel_model.py View File

@ -51,11 +51,6 @@ class ChannelModelTestCase(BaseTestCase):
self.assertEqual(c.opsgenie_key, "abc")
self.assertEqual(c.opsgenie_region, "eu")
def test_it_handles_legacy_sms_value(self):
c = Channel(kind="sms", value="+123123123")
self.assertTrue(c.sms_notify_down)
self.assertFalse(c.sms_notify_up)
def test_it_handles_legacy_sms_json_value(self):
c = Channel(kind="sms", value=json.dumps({"value": "+123123123"}))
self.assertTrue(c.sms_notify_down)


Loading…
Cancel
Save