bump suou requirement

This commit is contained in:
Yusur 2025-09-14 16:22:00 +02:00
parent 38f7e77791
commit f51f488567
3 changed files with 20 additions and 3 deletions

View file

@ -228,7 +228,9 @@ async def error_404(body):
except Exception as e: except Exception as e:
logger.error(f'Exception in find_guild_or_user: {e}') logger.error(f'Exception in find_guild_or_user: {e}')
pass pass
print(request.host) if app_config.server_name not in (None, request.host):
logger.warning(f'request host {request.host!r} is different from configured server name {app_config.server_name}')
return redirect('//' + app_config.server_name + request.full_path), 307
return await error_handler_for(404, 'Not found', '404.html') return await error_handler_for(404, 'Not found', '404.html')
@app.errorhandler(405) @app.errorhandler(405)

View file

@ -13,7 +13,7 @@ from werkzeug.security import check_password_hash
from suou.quart import add_rest from suou.quart import add_rest
from freak.accounts import LoginStatus, check_login from freak.accounts import LoginStatus, check_login
from freak.algorithms import topic_timeline, user_timeline from freak.algorithms import public_timeline, topic_timeline, user_timeline
from ..models import Guild, Post, User, db from ..models import Guild, Post, User, db
from .. import UserLoader, app, app_config, __version__ as freak_version, csrf from .. import UserLoader, app, app_config, __version__ as freak_version, csrf
@ -222,3 +222,18 @@ async def logout():
logout_user() logout_user()
return '', 204 return '', 204
## HOME ##
@bp.get('/home/feed')
@login_required
async def home_feed():
async with db as session:
me = current_user.user
posts = await db.paginate(public_timeline())
feed = []
async for post in posts:
feed.append(post.feed_info())
return dict(feed=feed)

View file

@ -19,7 +19,7 @@ dependencies = [
"libsass", "libsass",
"setuptools>=78.1.0", "setuptools>=78.1.0",
"Hypercorn", "Hypercorn",
"sakuragasaki46-suou>=0.6.0" "suou>=0.6.1"
] ]
requires-python = ">=3.10" requires-python = ">=3.10"
classifiers = [ classifiers = [