Commit 580dbfa7 authored by Jiahang Chen's avatar Jiahang Chen
Browse files

fix subthing id

parent dc576c61
Pipeline #439652 passed with stages
in 52 seconds
...@@ -610,8 +610,6 @@ def _getValue(self, source, uri_list): ...@@ -610,8 +610,6 @@ def _getValue(self, source, uri_list):
# ??? What if the uri points to a Value object? # ??? What if the uri points to a Value object?
# Shouldn't it be serialized?! # Shouldn't it be serialized?!
print(source)
print(uri_list)
value = source[uri_list[0]] value = source[uri_list[0]]
if uri_list.__len__() == 1: if uri_list.__len__() == 1:
# if is ditto-feature # if is ditto-feature
...@@ -969,7 +967,8 @@ def to_subthing_json(self): ...@@ -969,7 +967,8 @@ def to_subthing_json(self):
if self.thing_id: if self.thing_id:
json_out["identifier"] = self.thing_id json_out["identifier"] = self.thing_id
else: else:
json_out["identifier"] = self.model["attributes"]["identifier"] if self.model["attributes"].get("identifier") is not None:
json_out["identifier"] = self.model["attributes"]["identifier"]
for key in self.roles.keys(): for key in self.roles.keys():
json_out["roles"].append(self.roles[key].to_json()) json_out["roles"].append(self.roles[key].to_json())
for key in self.features.keys(): for key in self.features.keys():
......
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