Skip to content
Snippets Groups Projects
Commit 704ada7f authored by Dan Braghis's avatar Dan Braghis
Browse files

fixup! Allow categories to be required on application forms

parent ba79a76c
No related branches found
No related tags found
No related merge requests found
......@@ -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']:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment