From: Magnus Hagander Date: Thu, 4 May 2023 12:06:23 +0000 (+0200) Subject: Don't look at developer docs when getting released release notes X-Git-Url: http://git.postgresql.org/gitweb/delmail?a=commitdiff_plain;h=3fc419792413359ae8499938558e63b9157e8799;p=pgweb.git Don't look at developer docs when getting released release notes This could cause a crash when the devel version of the docs had a placeholder entry for a major version that had not yet been released. --- diff --git a/pgweb/docs/views.py b/pgweb/docs/views.py index fbb4a352..b37895ed 100644 --- a/pgweb/docs/views.py +++ b/pgweb/docs/views.py @@ -348,7 +348,7 @@ def release_notes(request, version): # If we have an exact match for our major version, get that one. If not, get the release # notes from the highest available version. - release_notes = exec_to_dict("SELECT content FROM docs WHERE file=%(filename)s ORDER BY version=%(major_version)s DESC, version DESC LIMIT 1", { + release_notes = exec_to_dict("SELECT content FROM docs WHERE file=%(filename)s AND version > 0 ORDER BY version=%(major_version)s DESC, version DESC LIMIT 1", { 'filename': version_file, 'major_version': major_version, })