From 3fc419792413359ae8499938558e63b9157e8799 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Thu, 4 May 2023 14:06:23 +0200 Subject: [PATCH] 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. --- pgweb/docs/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, }) -- 2.39.5