summaryrefslogtreecommitdiff
path: root/django/utils/timezone.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-04-03 20:37:32 -0400
committerTim Graham <timograham@gmail.com>2016-04-04 17:14:26 -0400
commit2cd2d188516475ddf256e6267cd82c495fb5c430 (patch)
tree1a7c3c167c1576923c7c4f5544495face5bd7327 /django/utils/timezone.py
parentd356bb653f4d90ae9809e5a051791ded39010c38 (diff)
Fixed W503 flake8 warnings.
Diffstat (limited to 'django/utils/timezone.py')
-rw-r--r--django/utils/timezone.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/django/utils/timezone.py b/django/utils/timezone.py
index 205cac44a9..20d59f5fed 100644
--- a/django/utils/timezone.py
+++ b/django/utils/timezone.py
@@ -288,10 +288,12 @@ def template_localtime(value, use_tz=None):
This function is designed for use by the template engine.
"""
- should_convert = (isinstance(value, datetime)
- and (settings.USE_TZ if use_tz is None else use_tz)
- and not is_naive(value)
- and getattr(value, 'convert_to_local_time', True))
+ should_convert = (
+ isinstance(value, datetime) and
+ (settings.USE_TZ if use_tz is None else use_tz) and
+ not is_naive(value) and
+ getattr(value, 'convert_to_local_time', True)
+ )
return localtime(value) if should_convert else value