From 2caf9a9fafab582f5da83ac82abd456c42285315 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 24 Feb 2023 03:47:50 +0200 Subject: [PATCH] remove redundant if condition --- files/routes/comments.py | 2 +- files/routes/users.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 284435377..aab6b49ca 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -318,7 +318,7 @@ def comment(v:User): n = Notification(comment_id=c.id, user_id=x) g.db.add(n) - if VAPID_PUBLIC_KEY != DEFAULT_CONFIG_VALUE and parent_user.id != v.id and not v.shadowbanned: + if parent_user.id != v.id and not v.shadowbanned: if isinstance(parent, User): title = f"New comment on your wall by @{c.author_name}" else: diff --git a/files/routes/users.py b/files/routes/users.py index da7c7621e..933369bcd 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -524,7 +524,7 @@ def message2(v:User, username:str): g.db.add(notif) - if VAPID_PUBLIC_KEY != DEFAULT_CONFIG_VALUE and not v.shadowbanned: + if not v.shadowbanned: title = f'New message from @{v.username}' if len(message) > 500: notifbody = message[:500] + '...' @@ -594,7 +594,7 @@ def messagereply(v:User): notif = Notification(comment_id=c.id, user_id=user_id) g.db.add(notif) - if VAPID_PUBLIC_KEY != DEFAULT_CONFIG_VALUE and not v.shadowbanned: + if not v.shadowbanned: title = f'New message from @{v.username}' if len(body) > 500: notifbody = body[:500] + '...'