diff --git a/pgweb/docs/views.py b/pgweb/docs/views.py index 94294cb..62ba460 100644 --- a/pgweb/docs/views.py +++ b/pgweb/docs/views.py @@ -268,6 +268,13 @@ def release_notes(request, major_version=None, minor_version=None): # notes # otherwise ensure the release notes are returned in order if major_version is not None and minor_version is not None: + # a quick check to see if major is one of 6 - 9 as a whole number. If + # it is, this may be because someone is trying ot look up, e.g. 9.1 + # directly even though the official number was 9.1.0. We shouldn't 404, + # we can make life slightly easier + if major_version in ['6', '7', '8', '9']: + major_version = "{}.{}".format(major_version, minor_version) + minor_version = '0' # at this point, include the content sql = sql.format(content="content,") # restrict to the major version, order from latest to earliest minor