diff --git a/hypha/apply/funds/admin_views.py b/hypha/apply/funds/admin_views.py index 60992135939ec368a4e853ee646eb32f5f1a4dcd..679444f6887b70c5b5dd8d5b9b906682c09b170c 100644 --- a/hypha/apply/funds/admin_views.py +++ b/hypha/apply/funds/admin_views.py @@ -101,6 +101,11 @@ class CopyApplicationFormViewClass(CreateView): class CreateApplicationFormView(CreateView): + def get_form(self): + form = super(CreateApplicationFormView, self).get_form() + form.fields['form_fields'].block.meta.block_counts = {'file': {'min_num': 0, 'max_num': 0}} + return form + def form_invalid(self, form): show_admin_form_error_messages(self.request, form) return self.render_to_response(self.get_context_data(form=form)) diff --git a/hypha/apply/funds/blocks.py b/hypha/apply/funds/blocks.py index b0cd5e227d497760879c58ce59c902e8c07490f7..266a9051054c38da92def89cd0b293ad4423d98d 100644 --- a/hypha/apply/funds/blocks.py +++ b/hypha/apply/funds/blocks.py @@ -195,9 +195,7 @@ class ApplicationCustomFormFieldsBlock(CustomFormFieldsBlock, FormFieldsBlock): single_blocks = ApplicationSingleIncludeFieldBlock.__subclasses__() class Meta: - block_counts = { - 'file': {'min_num': 0, 'max_num': 0}, - } + block_counts = {} REQUIRED_BLOCK_NAMES = [block.name for block in ApplicationMustIncludeFieldBlock.__subclasses__()]