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

MAINT: add fallback parent only when the object is created

parent 189ad328
Branches
Tags
2 merge requests!71REL: RElease v0.2.0,!38Create fallback parent only when Record object is created
Pipeline #30262 passed
......@@ -205,6 +205,10 @@ def create_records(values: GeneralStore,
# additionally add the new record to the general store:
values[name] = c_record
# add the "fallback" parent only for Records, not for Files:
if (role == "Record" and "parents" not in record):
c_record.add_parent(name)
c_record = records[name]
for key, value in record.items():
......@@ -252,12 +256,6 @@ def create_records(values: GeneralStore,
var_replaced_parent = replace_variables(parent, values)
if not has_parent(c_record, var_replaced_parent):
c_record.add_parent(var_replaced_parent)
else:
# add the "fallback" parent only for Records, not for Files:
if role == "Record":
# if not has_parent(c_record, name):
if len(c_record.parents) == 0:
c_record.add_parent(name)
return keys_modified
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment