From 31e42146209619c17710402aaadd4d643cab10e0 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 30 Nov 2021 20:22:31 +0200 Subject: [PATCH] dfssdf --- files/helpers/get.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/files/helpers/get.py b/files/helpers/get.py index 055902ea3..9df2bcb5f 100644 --- a/files/helpers/get.py +++ b/files/helpers/get.py @@ -3,7 +3,7 @@ from flask import g def get_id(username, v=None, graceful=False): - + username = username.replace('\\', '') username = username.replace('_', '\_') username = username.replace('%', '') @@ -28,6 +28,10 @@ def get_id(username, v=None, graceful=False): def get_user(username, v=None, graceful=False): + if not username: + if not graceful: abort(404) + else: return None + username = username.replace('\\', '') username = username.replace('_', '\_') username = username.replace('%', '') @@ -42,10 +46,8 @@ def get_user(username, v=None, graceful=False): ).first() if not user: - if not graceful: - abort(404) - else: - return None + if not graceful: abort(404) + else: return None if v: block = g.db.query(UserBlock).filter(