Skip to content

Commit f35aceb

Browse files
committed
Swap to ignroing W503
1 parent afd9563 commit f35aceb

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

debug_toolbar/apps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ def is_middleware_class(middleware_class, middleware_path):
7979
except ImportError:
8080
return
8181
return (
82-
inspect.isclass(middleware_cls) and
83-
issubclass(middleware_cls, middleware_class)
82+
inspect.isclass(middleware_cls)
83+
and issubclass(middleware_cls, middleware_class)
8484
)

debug_toolbar/panels/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def enabled(self):
3131
# For that reason, replace .panel. in the path and check for that
3232
# value in the disabled panels as well.
3333
disable_panel = (
34-
panel_path in disabled_panels or
35-
panel_path.replace('.panel.', '.') in disabled_panels)
34+
panel_path in disabled_panels
35+
or panel_path.replace('.panel.', '.') in disabled_panels)
3636
if disable_panel:
3737
default = 'off'
3838
else:

debug_toolbar/panels/templates/panel.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def _request_context_bind_template(self, template):
4141

4242
self.template = template
4343
# Set context processors according to the template engine's settings.
44-
processors = (template.engine.template_context_processors +
45-
self._processors)
44+
processors = (template.engine.template_context_processors
45+
+ self._processors)
4646
self.context_processors = OrderedDict()
4747
updates = {}
4848
for processor in processors:
@@ -85,10 +85,16 @@ def _store_template_info(self, sender, **kwargs):
8585
template, context = kwargs['template'], kwargs['context']
8686

8787
# Skip templates that we are generating through the debug toolbar.
88-
if (isinstance(template.name, six.string_types) and (
89-
template.name.startswith('debug_toolbar/') or
90-
template.name.startswith(
91-
tuple(self.toolbar.config['SKIP_TEMPLATE_PREFIXES'])))):
88+
is_debug_toolbar_template = (
89+
isinstance(template.name, six.string_types)
90+
and (
91+
template.name.startswith('debug_toolbar/')
92+
or template.name.startswith(
93+
tuple(self.toolbar.config['SKIP_TEMPLATE_PREFIXES'])
94+
)
95+
)
96+
)
97+
if is_debug_toolbar_template:
9298
return
9399

94100
context_list = []

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
tag_svn_revision = false
33

44
[flake8]
5-
ignore = W504, W601
5+
ignore = W503, W601
66
max-line-length = 100
77

88
[isort]

0 commit comments

Comments
 (0)