mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-03 15:38:59 +00:00
Correcly handle old versions of the docs, where the file extension is .htm
This commit is contained in:
@ -23,10 +23,15 @@ def docpage(request, version, typ, filename):
|
||||
else:
|
||||
ver = Decimal(version)
|
||||
|
||||
page = get_object_or_404(DocPage, version=ver, file="%s.html" % filename)
|
||||
if ver < Decimal("7.1"):
|
||||
extension = "htm"
|
||||
else:
|
||||
extension = "html"
|
||||
|
||||
page = get_object_or_404(DocPage, version=ver, file="%s.%s" % (filename, extension))
|
||||
|
||||
if typ=="interactive":
|
||||
comments = DocComment.objects.filter(version=ver, file="%s.html" % filename, approved=True).order_by('posted_at')
|
||||
comments = DocComment.objects.filter(version=ver, file="%s.%s" % (filename, extension), approved=True).order_by('posted_at')
|
||||
else:
|
||||
comments = None
|
||||
|
||||
|
Reference in New Issue
Block a user