Skip to content

Commit

Permalink
Use better default for allow_clear
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiefMaster committed Jul 16, 2020
1 parent 2154430 commit 2ed6f33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion indico/web/forms/fields/datetime.py
Expand Up @@ -179,9 +179,9 @@ class IndicoDateField(DateField):
widget = JinjaWidget('forms/date_widget.html', single_line=True, single_kwargs=True)

def __init__(self, *args, **kwargs):
self.allow_clear = kwargs.pop('allow_clear', True)
super(IndicoDateField, self).__init__(*args, parse_kwargs={'dayfirst': True},
display_format='%d/%m/%Y', **kwargs)
self.allow_clear = kwargs.pop('allow_clear', not self.flags.required)

@property
def earliest_date(self):
Expand Down

0 comments on commit 2ed6f33

Please sign in to comment.