From fba546003194180887f004395c30f85dbc603e49 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 30 Nov 2021 19:19:55 +0200 Subject: [PATCH] fd --- files/helpers/wrappers.py | 2 +- files/routes/posts.py | 2 +- files/routes/users.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index b3e683ee1..a029b7ce3 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -84,7 +84,7 @@ def is_not_banned(f): check_ban_evade(v) - if v.is_suspended: abort(403) + if v.is_suspended: return {"error": "You can't perform this action while being banned."}, 403 g.v = v diff --git a/files/routes/posts.py b/files/routes/posts.py index b7fee11f6..efda7c19a 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -587,7 +587,7 @@ def submit_post(v): domain = parsed_url.netloc qd = parse_qs(parsed_url.query) - filtered = dict((k, v) for k, v in qd.items() if not k.startswith('utm_')) + filtered = dict((k, v) for k, v in qd.items() if not k.startswith('utm_') and not k.startswith('ref_')) new_url = ParseResult(scheme="https", netloc=parsed_url.netloc, diff --git a/files/routes/users.py b/files/routes/users.py index 01357fb87..5cc62e9e6 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -873,6 +873,8 @@ def fp(v, fp): if v.username != fp: v.fp = fp users = g.db.query(User).filter(User.fp == fp, User.id != v.id).all() + if v.email and v.is_activated: + users += g.db.query(User).filter(User.email == email, User.is_activated, User.id != v.id).all() for u in users: li = [v.id, u.id] existing = g.db.query(Alt).filter(Alt.user1.in_(li), Alt.user2.in_(li)).first()