From 0b01696f5b5da436b0f3e15660c13e9b2089ece6 Mon Sep 17 00:00:00 2001 From: Acly Date: Mon, 14 Oct 2024 13:20:41 +0200 Subject: [PATCH] Fix workflow/unsubscribe endpoint --- krita.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/krita.py b/krita.py index 3297f76..5526e1f 100644 --- a/krita.py +++ b/krita.py @@ -34,8 +34,11 @@ class WorkflowExchange: for publisher in self._publishers.values(): await self._notify(client_id, publisher) - def unsubscribe(self, client_id: str): - self._subscribers.remove(client_id) + async def unsubscribe(self, client_id: str): + if client_id in self._subscribers: + self._subscribers.remove(client_id) + else: + raise KeyError("No subscriber found with id " + client_id) async def _notify(self, client_id: str, publisher: Publisher): data = {