From 2b9ab64f6ef88300032b671b246297688ff4a359 Mon Sep 17 00:00:00 2001 From: Lephe Date: Tue, 15 Nov 2022 11:03:36 +0100 Subject: [PATCH] routes: fix constant 404s due to new werkzeug handling of / --- app/utils/converters.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/utils/converters.py b/app/utils/converters.py index a6fe429..c9775b1 100644 --- a/app/utils/converters.py +++ b/app/utils/converters.py @@ -25,9 +25,10 @@ from slugify import slugify class ForumConverter(BaseConverter): - # This regex will decide which portion of the URL is matched by the curtom - # converter. By default, slashes are not included, so we must add them. + # This regex will decide which portion of the URL is converted. regex = r'[a-z/]+' + # Allow slashes to be matched by the regex (this is not by default) + part_isolating = False def to_python(self, url): url = '/' + url @@ -44,6 +45,7 @@ class PageConverter(BaseConverter): # Matches integers for the topic number, then either nothing, a page # number, a slug, or a page number followed by a slug regex = r'(\d+)(?:/(\d+)|/fin)?(?:/[\w-]+)?' + part_isolating = False object = None get_title = lambda o: "empty-title"