mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #28769 -- Replaced 'x if x else y' with 'x or y'.
This commit is contained in:
committed by
Tim Graham
parent
00b93c2b1e
commit
c69e4bc691
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user