From 704ada7fab29ee989acaf88056c162d67ece6382 Mon Sep 17 00:00:00 2001
From: Dan Braghis <dan.braghis@torchbox.com>
Date: Wed, 17 Jan 2018 13:47:01 +0000
Subject: [PATCH] fixup! Allow categories to be required on application forms

---
 opentech/apply/categories/blocks.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/opentech/apply/categories/blocks.py b/opentech/apply/categories/blocks.py
index c0916f175..e0c92bb60 100644
--- a/opentech/apply/categories/blocks.py
+++ b/opentech/apply/categories/blocks.py
@@ -5,7 +5,7 @@ from django.utils.translation import ugettext_lazy as _
 from wagtail.wagtailcore.blocks import BooleanBlock, CharBlock, ChooserBlock, TextBlock
 from wagtail.wagtailcore.utils import resolve_model_string
 
-from opentech.apply.stream_forms.blocks import FormFieldBlock
+from opentech.apply.stream_forms.blocks import OptionalFormFieldBlock
 
 
 class ModelChooserBlock(ChooserBlock):
@@ -20,7 +20,7 @@ class ModelChooserBlock(ChooserBlock):
         return resolve_model_string(self._target_model)
 
 
-class CategoryQuestionBlock(FormFieldBlock):
+class CategoryQuestionBlock(OptionalFormFieldBlock):
     # Overwrite field label and help text so we can defer to the category
     # as required
     field_label = CharBlock(
@@ -34,7 +34,6 @@ class CategoryQuestionBlock(FormFieldBlock):
     )
     category = ModelChooserBlock('categories.Category')
     multi = BooleanBlock(label='Multi select', required=False)
-    required = BooleanBlock(label='Required', required=False)
 
     def get_field_class(self, struct_value):
         if struct_value['multi']:
-- 
GitLab