Commit 2b86c2f9 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

Refactor conditional logic in SimplifiedProfileDelRefROHook a bit

This is a preparatory refactoring to ease introduction of a functional
change in the next changeset.
parent 181f83e6b545
......@@ -310,9 +310,11 @@ class SimplifiedProfileDelRefROHook(hook.Hook):
ref = self._cw.entity_from_eid(self.eidfrom)
bdo = self._cw.entity_from_eid(self.eidto)
if ref.cw_etype == 'SEDADataObjectReference' and bdo.cw_etype == 'SEDABinaryDataObject':
container = bdo.seda_binary_data_object[0] if bdo.seda_binary_data_object else None
if container and container.simplified_profile:
SimplifiedProfileDelRefROOp(self._cw, do_ref=ref, do=bdo)
if bdo.seda_binary_data_object:
container = bdo.seda_binary_data_object[0]
if not container.simplified_profile:
SimplifiedProfileDelRefROOp(self._cw, do_ref=ref, do=bdo)
class SimplifiedProfileDelRefROOp(hook.Operation):
Supports Markdown
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