From: Magnus Hagander Date: Sun, 6 Feb 2022 12:37:31 +0000 (+0100) Subject: Give priority to the "new style" of news links over the old X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=b0cd713640ded96973ffa104c9342e12b73cae54;p=pgweb.git 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. --- 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),