Skip to content
Snippets Groups Projects
Verified Commit 50e13c60 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

MAINT: Made the code a bit more readable.

parent f57f7f31
No related branches found
No related tags found
2 merge requests!43REL: Release 0.4.1,!41F fix assure in list
......@@ -412,13 +412,13 @@ def assure_object_is_in_list(obj, containing_object, property_name,
datatype=datatype)
# TODO: case where multiple times the same property exists is not treated
if containing_object.get_property(property_name).value is None:
containing_object.get_property(property_name).value = []
elif not isinstance(containing_object.get_property(property_name).value, list):
containing_object.get_property(property_name).value = [
containing_object.get_property(property_name).value]
containing_object.get_property(property_name).datatype = datatype
current_list = containing_object.get_property(property_name).value
list_prop = containing_object.get_property(property_name)
if list_prop.value is None:
list_prop.value = []
elif not isinstance(list_prop.value, list):
list_prop.value = [list_prop.value]
list_prop.datatype = datatype
current_list = list_prop.value
if not isinstance(obj, list):
objects = [obj]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment