mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-06 09:57:57 +00:00
Style fixups to pass pep checks
This fixes the style issues introduced in the patches for the new release notes styles. Clearly a broken verification hook somewhere.
This commit is contained in:
@ -71,6 +71,7 @@ def dictlookup(value, key):
|
|||||||
def tojson(value):
|
def tojson(value):
|
||||||
return json.dumps(value)
|
return json.dumps(value)
|
||||||
|
|
||||||
|
|
||||||
@register.filter()
|
@register.filter()
|
||||||
def release_notes_pg_minor_version(minor_version, major_version):
|
def release_notes_pg_minor_version(minor_version, major_version):
|
||||||
"""Formats the minor version number to the appropriate PostgreSQL version.
|
"""Formats the minor version number to the appropriate PostgreSQL version.
|
||||||
|
@ -65,7 +65,7 @@ def docpage(request, version, filename):
|
|||||||
# figure out which version to redirect to. Note that the oldest version
|
# figure out which version to redirect to. Note that the oldest version
|
||||||
# of the docs loaded is 7.2
|
# of the docs loaded is 7.2
|
||||||
release_version = re.sub(r'release-((\d+)(-\d+)?)(-\d+)?.html',
|
release_version = re.sub(r'release-((\d+)(-\d+)?)(-\d+)?.html',
|
||||||
r'\1', fullname).replace('-', '.')
|
r'\1', fullname).replace('-', '.')
|
||||||
# convert to Decimal for ease of manipulation
|
# convert to Decimal for ease of manipulation
|
||||||
try:
|
try:
|
||||||
release_version = Decimal(release_version)
|
release_version = Decimal(release_version)
|
||||||
@ -176,6 +176,7 @@ def manualarchive(request):
|
|||||||
'versions': [_VersionPdfWrapper(v) for v in versions],
|
'versions': [_VersionPdfWrapper(v) for v in versions],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
def release_notes(request, major_version=None, minor_version=None):
|
def release_notes(request, major_version=None, minor_version=None):
|
||||||
"""Contains the main archive of release notes."""
|
"""Contains the main archive of release notes."""
|
||||||
# this query gets a list of a unique set of release notes for each version of
|
# this query gets a list of a unique set of release notes for each version of
|
||||||
@ -271,9 +272,10 @@ def release_notes(request, major_version=None, minor_version=None):
|
|||||||
'release_notes': release_notes
|
'release_notes': release_notes
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
context = { 'release_notes': release_notes }
|
context = {'release_notes': release_notes}
|
||||||
return render_pgweb(request, 'docs', 'docs/release_notes.html', context)
|
return render_pgweb(request, 'docs', 'docs/release_notes.html', context)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def commentform(request, itemid, version, filename):
|
def commentform(request, itemid, version, filename):
|
||||||
if version == 'current':
|
if version == 'current':
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from django.db import connection
|
from django.db import connection
|
||||||
|
|
||||||
|
|
||||||
def exec_to_dict(query, params=None):
|
def exec_to_dict(query, params=None):
|
||||||
curs = connection.cursor()
|
curs = connection.cursor()
|
||||||
curs.execute(query, params)
|
curs.execute(query, params)
|
||||||
|
Reference in New Issue
Block a user