diff --git a/opentech/apply/funds/blocks.py b/opentech/apply/funds/blocks.py index 911c1ade34c0d4133df5b52c5f76196bb2f5e517..e14d6b0b579c9b47c176df44c393f32cf625c356 100644 --- a/opentech/apply/funds/blocks.py +++ b/opentech/apply/funds/blocks.py @@ -47,17 +47,8 @@ class RichTextFieldBlock(TextFieldBlock): icon = 'form' -class AddressFieldBlock(OptionalFormFieldBlock): - widget = AddressWidget - - class Meta: - label = _('Address') - icon = 'home' - - class CustomFormFieldsBlock(FormFieldsBlock): rich_text = RichTextFieldBlock(group=_('Fields')) - address = AddressFieldBlock(group=_('Fields')) category = CategoryQuestionBlock(group=_('Custom')) def __init__(self, *args, **kwargs): @@ -172,6 +163,16 @@ class EmailBlock(MustIncludeFieldBlock): icon = 'mail' +class AddressFieldBlock(MustIncludeFieldBlock): + name = 'address' + description = 'The postal address of the user' + widget = AddressWidget + + class Meta: + label = _('Address') + icon = 'home' + + class FullNameBlock(MustIncludeFieldBlock): name = 'full_name' description = 'Full name' diff --git a/opentech/apply/funds/widgets.py b/opentech/apply/funds/widgets.py index a9cda6fc7aff245d9ccc0947e89db58630cbf348..99b9c9e6c5967898f255b729e3b16b75aa6a1481 100644 --- a/opentech/apply/funds/widgets.py +++ b/opentech/apply/funds/widgets.py @@ -25,7 +25,7 @@ class NestedMultiWidget(KeepOwnAttrsWidget, forms.MultiWidget): def __init__(self, *args, **kwargs): widgets = [ - widget(attrs={'class': field}) for field, widget in self.components.items() + widget(attrs={'class': field, 'required': False}) for field, widget in self.components.items() ] super().__init__(widgets, *args, **kwargs)