Skip to content
Snippets Groups Projects
Commit a2bde750 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Ensure that the field is required on the form

parent 6664e27d
No related branches found
No related tags found
No related merge requests found
...@@ -91,6 +91,11 @@ class MustIncludeFieldBlock(FormFieldBlock): ...@@ -91,6 +91,11 @@ class MustIncludeFieldBlock(FormFieldBlock):
child_blocks = [('info', MustIncludeStatic(label=info_name, description=self.description))] child_blocks = [('info', MustIncludeStatic(label=info_name, description=self.description))]
super().__init__(child_blocks, *args, **kwargs) super().__init__(child_blocks, *args, **kwargs)
def get_field_kwargs(self, struct_value):
kwargs = super().get_field_kwargs(struct_value)
kwargs['required'] = True
return kwargs
class TitleBlock(MustIncludeFieldBlock): class TitleBlock(MustIncludeFieldBlock):
name = 'title' name = 'title'
......
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