From b0cd713640ded96973ffa104c9342e12b73cae54 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sun, 6 Feb 2022 13:37:31 +0100 Subject: [PATCH] Give priority to the "new style" of news links over the old This affects how we redirect news when tehre's what looks like an "id" number both before and after. For example, the link: 2016-08-11-security-update-release-1688 would previously detect the id as 2017 and redirect to that article, which is obviously wrong. This changes the order so that id-at-the-end is checked first. This instead gives problems for urls that *end* in a year (or other things that looks like an id). This is not ideal, but it's better than before because at least now the links that are being generated *now* are handled the correct way. --- pgweb/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgweb/urls.py b/pgweb/urls.py index 78b61cee..f349f0a1 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -35,8 +35,8 @@ urlpatterns = [ url(r'^about/$', pgweb.core.views.about), url(r'^about/newsarchive/(?P[^/]*/)?(?P[0-9]{8}/)?$', pgweb.news.views.archive), - url(r'^about/news/(?P\d+)(?P-.*)?/$', pgweb.news.views.item), url(r'^about/news/(?P[^/]+)-(?P\d+)/$', pgweb.news.views.item), + url(r'^about/news/(?P\d+)(?P-.*)?/$', pgweb.news.views.item), url(r'^about/news/taglist.json/$', pgweb.news.views.taglist_json), url(r'^about/events/$', pgweb.events.views.main), url(r'^about/eventarchive/$', pgweb.events.views.archive), -- 2.39.5