From c6baf60295e4bee4e4c13cf5c628ccd3ab89b141 Mon Sep 17 00:00:00 2001 From: sinavir Date: Sun, 21 Apr 2024 20:50:30 +0200 Subject: [PATCH] fix: tag synchronisation again --- stateless_uptime_kuma/uptime_kuma.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stateless_uptime_kuma/uptime_kuma.py b/stateless_uptime_kuma/uptime_kuma.py index 742b385..10f1f0f 100644 --- a/stateless_uptime_kuma/uptime_kuma.py +++ b/stateless_uptime_kuma/uptime_kuma.py @@ -138,9 +138,11 @@ class Monitor(Item): (i["tag_id"], i["value"]) for i in self.api.get_monitor(self.id)["tags"] ) for t, v in self.tags: + if v is None: + v = "" if (t.id, v) not in current_tags: logger.debug(f"Adding tag: '{t}, {v}'") - self.api.add_monitor_tag(tag_id=t.id, monitor_id=self.id, value=v if v is not None else "") + self.api.add_monitor_tag(tag_id=t.id, monitor_id=self.id, value=v) self.saved = True def __repr__(self):