From 239faac7dd9de9bb073ba817c47616c621ab7132 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 5 Dec 2021 22:56:34 +0100 Subject: [PATCH] fix(plugin): Only active users can and should be notified --- flaschengeist/plugins/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flaschengeist/plugins/__init__.py b/flaschengeist/plugins/__init__.py index 4f253ab..bf32013 100644 --- a/flaschengeist/plugins/__init__.py +++ b/flaschengeist/plugins/__init__.py @@ -102,9 +102,10 @@ class Plugin: db.session.commit() def notify(self, user, text: str, data=None): - n = Notification(text=text, data=data, plugin=self.id, user_=user) - db.session.add(n) - db.session.commit() + if not user.deleted: + n = Notification(text=text, data=data, plugin=self.id, user_=user) + db.session.add(n) + db.session.commit() def serialize(self): """Serialize a plugin into a dict