summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorДилян Палаузов <dilyanpalauzov@users.noreply.github.com>2017-11-06 10:23:29 -0500
committerTim Graham <timograham@gmail.com>2017-11-07 09:08:46 -0500
commitc69e4bc69166b2d752b437a651dfa91f8b53ecfd (patch)
tree49cb2c1b54962eff1a02636062b213397003e7ed /django/forms
parent00b93c2b1ecdda978f067309c6feafda633a7264 (diff)
Fixed #28769 -- Replaced 'x if x else y' with 'x or y'.
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/widgets.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 47396213d9..498185fe23 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -474,7 +474,7 @@ class DateTimeBaseInput(TextInput):
def __init__(self, attrs=None, format=None):
super().__init__(attrs)
- self.format = format if format else None
+ self.format = format or None
def format_value(self, value):
return formats.localize_input(value, self.format or formats.get_format(self.format_key)[0])