mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-03 15:38:59 +00:00
Redirect docs requests for 10.0 to 10
This will include future 11.0 -> 11 as well, etc, for good measure.
This commit is contained in:
@ -47,6 +47,11 @@ def docpage(request, version, typ, filename):
|
||||
else:
|
||||
indexname = "index.html"
|
||||
|
||||
if ver >= 10 and version.find('.') > -1:
|
||||
# Version 10 and up, but specified as 10.0 / 11.0 etc, so redirect back without the
|
||||
# decimal.
|
||||
return HttpResponseRedirect("/docs/{0}/static/{1}.html".format(int(ver), filename))
|
||||
|
||||
fullname = "%s.%s" % (filename, extension)
|
||||
page = get_object_or_404(DocPage, version=ver, file=fullname)
|
||||
versions = DocPage.objects.filter(file=fullname).extra(select={
|
||||
|
Reference in New Issue
Block a user