diff --git a/files/routes/front.py b/files/routes/front.py index 419e03dc7..fa11d9fcb 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -170,7 +170,7 @@ def random_user(v:User): u = g.db.query(User.username).filter(User.song != None, User.shadowbanned == None).order_by(func.random()).first() if u: u = u[0] - else: return "No users have set a profile anthem so far!" + else: abort(404, "No users have set a profile anthem so far!") return redirect(f"/@{u}") diff --git a/files/routes/login.py b/files/routes/login.py index 47175ff44..514ef2fb8 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -52,7 +52,7 @@ def login_post(): if "@" in username: try: account = g.db.query(User).filter(User.email.ilike(username)).one_or_none() - except: return "Multiple users use this email!" + except: abort(400, "Multiple usernames have this email attached;
Please specify the username you want to login to!") else: account = get_user(username, graceful=True) if not account: diff --git a/files/routes/subs.py b/files/routes/subs.py index 0e8a06426..42df2370a 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -399,7 +399,7 @@ def post_sub_sidebar(v, sub): sub.sidebar = request.values.get('sidebar', '').strip()[:10000] sub.sidebar_html = sanitize(sub.sidebar) - if len(sub.sidebar_html) > 20000: return "Sidebar is too big!" + if len(sub.sidebar_html) > 20000: abort(400, "Sidebar is too big!") g.db.add(sub)