Skip to content

Commit f20c64c

Browse files
committed
convenience mirroring some fixes from trunk
- Legacy-Id: 16512
1 parent 8d2d732 commit f20c64c

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

ietf/checks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,10 @@ def maybe_patch_library(app_configs, **kwargs):
400400
@checks.register('security')
401401
def check_api_key_in_local_settings(app_configs, **kwargs):
402402
errors = []
403-
import settings_local
403+
import ietf.settings_local
404404
if settings.SERVER_MODE == 'production':
405-
if not ( hasattr(settings_local, 'API_PUBLIC_KEY_PEM')
406-
and hasattr(settings_local, 'API_PRIVATE_KEY_PEM')):
405+
if not ( hasattr(ietf.settings_local, 'API_PUBLIC_KEY_PEM')
406+
and hasattr(ietf.settings_local, 'API_PRIVATE_KEY_PEM')):
407407
errors.append(checks.Critical(
408408
"There are no API key settings in your settings_local.py",
409409
hint = dedent("""
@@ -417,8 +417,8 @@ def check_api_key_in_local_settings(app_configs, **kwargs):
417417
""").replace('\n', '\n ').rstrip(),
418418
id = "datatracker.E0020",
419419
))
420-
elif not ( settings_local.API_PUBLIC_KEY_PEM == settings.API_PUBLIC_KEY_PEM
421-
and settings_local.API_PRIVATE_KEY_PEM == settings.API_PRIVATE_KEY_PEM ):
420+
elif not ( ietf.settings_local.API_PUBLIC_KEY_PEM == settings.API_PUBLIC_KEY_PEM
421+
and ietf.settings_local.API_PRIVATE_KEY_PEM == settings.API_PRIVATE_KEY_PEM ):
422422
errors.append(checks.Critical(
423423
"Your API key settings in your settings_local.py are not picked up in settings.",
424424
hint = dedent("""

ietf/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ def skip_unreadable_post(record):
10591059

10601060
# Put the production SECRET_KEY in settings_local.py, and also any other
10611061
# sensitive or site-specific changes. DO NOT commit settings_local.py to svn.
1062-
from settings_local import * # pyflakes:ignore pylint: disable=wildcard-import
1062+
from ietf.settings_local import * # pyflakes:ignore pylint: disable=wildcard-import
10631063

10641064
for app in INSTALLED_APPS:
10651065
if app.startswith('ietf'):

ietf/utils/pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
def pdf_pages(filename):
1111
"""Return number of pages in PDF."""
1212
try:
13-
infile = io.open(filename, "r")
13+
infile = io.open(filename, "rb")
1414
except IOError:
1515
return 0
1616
for line in infile:
17-
m = re.match(r'\] /Count ([0-9]+)',line)
17+
m = re.match(br'\] /Count ([0-9]+)',line)
1818
if m:
1919
return int(m.group(1))
2020
return 0

0 commit comments

Comments
 (0)