Fix bug for release notes version display
authorJonathan S. Katz <jonathan.katz@excoventures.com>
Thu, 30 Sep 2021 12:45:02 +0000 (08:45 -0400)
committerJonathan S. Katz <jonathan.katz@excoventures.com>
Thu, 30 Sep 2021 12:45:02 +0000 (08:45 -0400)
On new major release, we were including the "-0" for the link
to the release notes. This should not be included. This likely
affected all new major releases, but went unnoticed for some
time.

pgweb/core/models.py

index 47e412e2e2f1969b2a393eba6da4cd04661746da..df29ed3733620a4e9887b0189f2df46ffbc45ed7 100644 (file)
@@ -47,6 +47,8 @@ class Version(models.Model):
     @property
     def relnotes(self):
         if self.tree >= Decimal('8.2'):
+            if self.latestminor == 0:
+                return 'release-{}.html'.format(str(self.numtree).replace('.', '-'))
             return 'release-{}-{}.html'.format(str(self.numtree).replace('.', '-'), self.latestminor)
         elif self.tree >= Decimal('7.1'):
             return 'release.html'