return 404 where it makes sense
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from flask import (
|
||||
Blueprint, render_template, request, redirect, url_for, flash, session, current_app
|
||||
Blueprint, render_template, request, redirect, url_for, flash, session, current_app, abort
|
||||
)
|
||||
from functools import wraps
|
||||
from ..db import db
|
||||
@@ -295,6 +295,8 @@ def sign_up_post():
|
||||
@bp.get("/<username>")
|
||||
def page(username):
|
||||
target_user = Users.find({"username": username.lower()})
|
||||
if not target_user:
|
||||
abort(404)
|
||||
return render_template("users/user.html", target_user = target_user)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user