forked from CGM_Public/pretix_original
DateFrameWidget: Improve dealing with required fields
This commit is contained in:
@@ -301,6 +301,8 @@ class DateFrameWidget(forms.MultiWidget):
|
|||||||
def get_context(self, name, value, attrs):
|
def get_context(self, name, value, attrs):
|
||||||
ctx = super().get_context(name, value, attrs)
|
ctx = super().get_context(name, value, attrs)
|
||||||
ctx['required'] = self.timeframe_choices[0][0] == 'unset'
|
ctx['required'] = self.timeframe_choices[0][0] == 'unset'
|
||||||
|
ctx['widget']['subwidgets'][1]['attrs'].pop('required', None)
|
||||||
|
ctx['widget']['subwidgets'][2]['attrs'].pop('required', None)
|
||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user