Ignore accounts without address, add user page

This commit is contained in:
dsc 2022-03-12 22:14:27 +02:00
parent cc0c35814f
commit 9a51c3c4fb
4 changed files with 59 additions and 2 deletions

View file

@ -70,6 +70,19 @@ async def search():
return await render_template('search.html', users=users)
@bp_routes.route("/user/<path:name>")
async def user_page(name: str):
if not name or len(name) <= 1:
raise Exception("invalid name")
_user = User.select().where(
User.username == name,
User.address.is_null(False)
).get()
return await render_template('user.html', users=[_user])
@bp_routes.route("/about")
async def about():
return await render_template('about.html')