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

Ensure that title is included in the tests and full_name works on create

parent 3ae43f89
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,11 @@ class RadioFieldBlockFactory(FormFieldBlockFactory): ...@@ -35,6 +35,11 @@ class RadioFieldBlockFactory(FormFieldBlockFactory):
model = stream_blocks.RadioButtonsFieldBlock model = stream_blocks.RadioButtonsFieldBlock
class TitleBlockFactory(FormFieldBlockFactory):
class Meta:
model = blocks.TitleBlock
class EmailBlockFactory(FormFieldBlockFactory): class EmailBlockFactory(FormFieldBlockFactory):
class Meta: class Meta:
model = blocks.EmailBlock model = blocks.EmailBlock
...@@ -51,6 +56,7 @@ class RichTextFieldBlockFactory(FormFieldBlockFactory): ...@@ -51,6 +56,7 @@ class RichTextFieldBlockFactory(FormFieldBlockFactory):
CustomFormFieldsFactory = wagtail_factories.StreamFieldFactory({ CustomFormFieldsFactory = wagtail_factories.StreamFieldFactory({
'title': TitleBlockFactory,
'email': EmailBlockFactory, 'email': EmailBlockFactory,
'full_name': FullNameBlockFactory, 'full_name': FullNameBlockFactory,
'char': CharFieldBlockFactory, 'char': CharFieldBlockFactory,
......
...@@ -6,8 +6,9 @@ from .utils import send_activation_email ...@@ -6,8 +6,9 @@ from .utils import send_activation_email
def convert_full_name_to_parts(defaults): def convert_full_name_to_parts(defaults):
full_name = defaults.pop('full_name') full_name = defaults.pop('full_name', ' ')
if not full_name: if not full_name:
# full_name was None
full_name = ' ' full_name = ' '
first_name, *last_name = full_name.split(' ') first_name, *last_name = full_name.split(' ')
if first_name: if first_name:
......
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