diff --git a/intranet/middleware/profiler.py b/intranet/middleware/profiler.py index f6cc145be23..d0c9ad3ab45 100644 --- a/intranet/middleware/profiler.py +++ b/intranet/middleware/profiler.py @@ -10,9 +10,9 @@ import resource import tempfile import time -from typing import Any from collections import defaultdict from io import StringIO +from typing import Any # noqa import cProfile diff --git a/intranet/settings/base.py b/intranet/settings/base.py index 64744a5f31a..e7697839cf0 100644 --- a/intranet/settings/base.py +++ b/intranet/settings/base.py @@ -6,7 +6,7 @@ import subprocess import sys from datetime import datetime, timedelta -from typing import AbstractSet, Any +from typing import AbstractSet, Any # noqa logger = logging.getLogger(__name__) @@ -51,11 +51,11 @@ 'ENGINE': 'django.db.backends.postgresql', 'CONN_MAX_AGE': 30 } - } # type: Dict[str,Dict[str,Any]] +} # type: Dict[str,Dict[str,Any]] class MigrationMock(object): - seen = set() # type: AbstractSet[str] + seen = set() # type: AbstractSet[str] def __contains__(self, mod): return True @@ -331,20 +331,20 @@ def get_month_seconds(): SESSION_COOKIE_AGE = int(timedelta(hours=2).total_seconds()) SESSION_SAVE_EVERY_REQUEST = True -CACHES = {"default": {"OPTIONS": {}}} # type: Dict[str,Dict[str,Any]] +CACHES = {"default": {"OPTIONS": {}}} # type: Dict[str,Dict[str,Any]] if TESTING or os.getenv("DUMMY_CACHE", "NO") == "YES": CACHES["default"]["BACKEND"] = "django.core.cache.backends.dummy.DummyCache" else: CACHES["default"] = { - "BACKEND": "redis_cache.RedisCache", - "LOCATION": "127.0.0.1:6379", - "OPTIONS": { - "PARSER_CLASS": "redis.connection.HiredisParser", - "PICKLE_VERSION": 4, - }, - "KEY_PREFIX": VIRTUAL_ENV - } + "BACKEND": "redis_cache.RedisCache", + "LOCATION": "127.0.0.1:6379", + "OPTIONS": { + "PARSER_CLASS": "redis.connection.HiredisParser", + "PICKLE_VERSION": 4, + }, + "KEY_PREFIX": VIRTUAL_ENV + } # LDAP configuration @@ -432,7 +432,7 @@ def get_month_seconds(): "widget_tweaks", "corsheaders", "cacheops" - ] +] # Eighth period default block date format EIGHTH_BLOCK_DATE_FORMAT = "D, N j, Y" @@ -565,7 +565,7 @@ def get_log(name): DEBUG_TOOLBAR_CONFIG = { "INTERCEPT_REDIRECTS": False, "DISABLE_PANELS": [panel for panel, enabled in _panels if not enabled] - } # type: Dict[str,Any] + } # type: Dict[str,Any] DEBUG_TOOLBAR_PANELS = [t[0] for t in _panels] @@ -578,7 +578,7 @@ def get_log(name): INSTALLED_APPS += [ "debug_toolbar", "debug_toolbar_line_profiler", - ] + ] def debug_toolbar_callback(request): """Show the debug toolbar to those with the Django staff permission, excluding