fix(plugin): Only active users can and should be notified

This commit is contained in:
Ferdinand Thiessen 2021-12-05 22:56:34 +01:00
parent 5819a0637f
commit 239faac7dd
1 changed files with 4 additions and 3 deletions

View File

@ -102,9 +102,10 @@ class Plugin:
db.session.commit() db.session.commit()
def notify(self, user, text: str, data=None): def notify(self, user, text: str, data=None):
n = Notification(text=text, data=data, plugin=self.id, user_=user) if not user.deleted:
db.session.add(n) n = Notification(text=text, data=data, plugin=self.id, user_=user)
db.session.commit() db.session.add(n)
db.session.commit()
def serialize(self): def serialize(self):
"""Serialize a plugin into a dict """Serialize a plugin into a dict