diff --git a/opentech/apply/utils/blocks.py b/opentech/apply/utils/blocks.py index 124911764a253306a9d04f7f77cf961e6fe6b525..1cd8182090a2f4709317eb7f5b4aeb487785a652 100644 --- a/opentech/apply/utils/blocks.py +++ b/opentech/apply/utils/blocks.py @@ -79,7 +79,7 @@ class CustomFormFieldsBlock(StreamBlock): if duplicates: all_errors.append( - 'You have duplicates of the following non duplicate fields: {}'.format(', '.join(prettify_names(duplicates))) + 'The following fields must be included only once: {}'.format(', '.join(prettify_names(duplicates))) ) for i, block_name in enumerate(block_types): if block_name in duplicates: @@ -117,6 +117,7 @@ class SingleIncludeStatic(StaticBlock): """Helper block which displays additional information about the must include block and helps display the error in a noticeable way. """ + def __init__(self, *args, description='', **kwargs): self.description = description super().__init__(*args, **kwargs) @@ -155,6 +156,7 @@ class MustIncludeFieldBlock(SingleIncludeMixin, FormFieldBlock): """Any block inheriting from this will need to be included in the application forms This data will also be available to query on the submission object """ + def get_field_kwargs(self, struct_value): kwargs = super().get_field_kwargs(struct_value) kwargs['required'] = True