Change the content block type only if the user specifies a type
This commit is contained in:
parent
5ae47029a3
commit
bdfd6ee510
|
|
@ -33,7 +33,10 @@ class MutateContentBlock(relay.ClientIDMutation):
|
||||||
|
|
||||||
content_block = get_object(ContentBlock, id_param)
|
content_block = get_object(ContentBlock, id_param)
|
||||||
|
|
||||||
block_type = content_block_data.get('type', content_block.type.upper())
|
block_type = content_block_data.get('type')
|
||||||
|
if block_type is not None: # only change the type if the user has set a type
|
||||||
|
content_block.type = set_user_defined_block_type(block_type)
|
||||||
|
|
||||||
module = content_block.get_parent().get_parent().specific
|
module = content_block.get_parent().get_parent().specific
|
||||||
|
|
||||||
if visibility_list is not None:
|
if visibility_list is not None:
|
||||||
|
|
@ -48,7 +51,7 @@ class MutateContentBlock(relay.ClientIDMutation):
|
||||||
if contents is not None:
|
if contents is not None:
|
||||||
content_block.contents = json.dumps([handle_content_block(c, info.context, module) for c in contents])
|
content_block.contents = json.dumps([handle_content_block(c, info.context, module) for c in contents])
|
||||||
|
|
||||||
content_block.type = set_user_defined_block_type(block_type)
|
|
||||||
content_block.save()
|
content_block.save()
|
||||||
|
|
||||||
return cls(content_block=content_block)
|
return cls(content_block=content_block)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue