From be07e53d542265b802da8bfb93224869d2866ce8 Mon Sep 17 00:00:00 2001
From: Dan Braghis <dan.braghis@torchbox.com>
Date: Wed, 18 Jul 2018 11:47:05 +0100
Subject: [PATCH] fixup! Move required field block definitions to utils

---
 opentech/apply/funds/blocks.py | 3 +++
 opentech/apply/funds/models.py | 4 ++--
 opentech/apply/utils/blocks.py | 3 ---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/opentech/apply/funds/blocks.py b/opentech/apply/funds/blocks.py
index a8e0c79a4..416234725 100644
--- a/opentech/apply/funds/blocks.py
+++ b/opentech/apply/funds/blocks.py
@@ -53,3 +53,6 @@ class FullNameBlock(ApplicationMustIncludeFieldBlock):
 class ApplicationCustomFormFieldsBlock(CustomFormFieldsBlock, FormFieldsBlock):
     category = CategoryQuestionBlock(group=_('Custom'))
     required_blocks = ApplicationMustIncludeFieldBlock.__subclasses__()
+
+
+REQUIRED_BLOCK_NAMES = [block.name for block in ApplicationMustIncludeFieldBlock.__subclasses__()]
diff --git a/opentech/apply/funds/models.py b/opentech/apply/funds/models.py
index 74d0017f1..6f30c715b 100644
--- a/opentech/apply/funds/models.py
+++ b/opentech/apply/funds/models.py
@@ -36,10 +36,10 @@ from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormSubmissi
 from opentech.apply.stream_forms.blocks import UploadableMediaBlock
 from opentech.apply.stream_forms.models import AbstractStreamForm, BaseStreamForm
 from opentech.apply.users.groups import REVIEWER_GROUP_NAME, STAFF_GROUP_NAME
-from opentech.apply.utils.blocks import MustIncludeFieldBlock, REQUIRED_BLOCK_NAMES
+from opentech.apply.utils.blocks import MustIncludeFieldBlock
 
 from .admin_forms import WorkflowFormAdminForm
-from .blocks import ApplicationCustomFormFieldsBlock
+from .blocks import ApplicationCustomFormFieldsBlock, REQUIRED_BLOCK_NAMES
 from .edit_handlers import FilteredFieldPanel, ReadOnlyPanel, ReadOnlyInlinePanel
 from .workflow import (
     active_statuses,
diff --git a/opentech/apply/utils/blocks.py b/opentech/apply/utils/blocks.py
index 73dd805b6..5c0e7dbcc 100644
--- a/opentech/apply/utils/blocks.py
+++ b/opentech/apply/utils/blocks.py
@@ -161,6 +161,3 @@ class MustIncludeFieldBlock(FormFieldBlock):
         kwargs = super().get_field_kwargs(struct_value)
         kwargs['required'] = True
         return kwargs
-
-
-REQUIRED_BLOCK_NAMES = [block.name for block in MustIncludeFieldBlock.__subclasses__()]
-- 
GitLab