Skip to content
Snippets Groups Projects
Commit 7aa7832c authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

force

parent bbd6a022
No related branches found
No related tags found
No related merge requests found
...@@ -280,7 +280,8 @@ def assure_object_is_in_list(obj, containing_object, property_name, ...@@ -280,7 +280,8 @@ def assure_object_is_in_list(obj, containing_object, property_name,
to_be_updated.append(containing_object) to_be_updated.append(containing_object)
def assure_has_parent(entity, parent, to_be_updated=None, verbosity=INFO): def assure_has_parent(entity, parent, to_be_updated=None, verbosity=INFO,
force=False):
""" """
Checks whether `entity` has a parent with name `parent`. Checks whether `entity` has a parent with name `parent`.
...@@ -314,7 +315,13 @@ def assure_has_parent(entity, parent, to_be_updated=None, verbosity=INFO): ...@@ -314,7 +315,13 @@ def assure_has_parent(entity, parent, to_be_updated=None, verbosity=INFO):
if to_be_updated is None: if to_be_updated is None:
get_ids_for_entities_with_names([entity]) get_ids_for_entities_with_names([entity])
guard.safe_update(entity, unique=False) # TODO move the unique argument?
# TODO find a better way then force?
if force:
entity.update(unique=False)
else:
guard.safe_update(entity, unique=False)
else: else:
to_be_updated.append(entity) to_be_updated.append(entity)
......
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