ensure trailing slashes in all routes

This commit is contained in:
2026-04-17 10:45:54 +03:00
parent 9d8404b774
commit d2cdeaed1d
5 changed files with 19 additions and 19 deletions

View File

@@ -10,13 +10,13 @@ def all_topics():
topic_list = Topics.get_list()
return render_template('topics/topics.html', topics=topic_list)
@bp.get('/<slug>')
@bp.get('/<slug>/')
def topic(slug):
topic = Topics.find({'slug': slug})
if not topic:
abort(404)
sort_by = request.args.get('sort_by', default=session.get('sort_by', default='activity'))
PER_PAGE = 10
PER_PAGE = 3
threads_count = Threads.count({'topic_id': topic.id})
page_count = max(1, math.ceil(threads_count / PER_PAGE))
try: