Commit 62ffe547 authored by Katia Saurfelt's avatar Katia Saurfelt
Browse files

feat: Ensure wrap_dataobjects is False for simplified profiles

--HG--
branch : seda21
parent fa4ed01f1c93
Pipeline #90188 failed with stages
in 40 seconds
......@@ -269,6 +269,22 @@ class SetDefaultCodeListVersionsOp(hook.Operation):
)
class SetWrapObjectHook(hook.Hook):
"""Ensure simplifed profiles has wrap_object relation set to False."""
__regid__ = "seda.transfer.wrap_object"
__select__ = hook.Hook.__select__ & is_instance("SEDAArchiveTransfer")
events = ("after_add_entity", "after_update_entity")
def __call__(self):
if "simplified_profile" in self.entity.cw_edited:
if (
self.entity.cw_edited["simplified_profile"]
and not self.entity.wrap_dataobjects
):
self.entity.cw_set(wrap_dataobjects=False)
class SetDefaultDataObjectRefCardinalityHook(hook.Hook):
"""Hook triggering an operation to set cardinality to 1 on creation of a data object 'typed'
reference.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment