Skip to content

Commit 9ebd2cb

Browse files
dill0wnbrondsem
authored andcommitted
[#8538] add new get_object_from_id timeline helper method which tries to find an object from an allura_id
1 parent d3c5f4b commit 9ebd2cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Allura/allura/model/timeline.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ def get_activity_object(activity_object_dict):
138138
allura_id = get_allura_id(activity_object_dict)
139139
if not allura_id:
140140
return None
141-
classname, _id = allura_id.split(':', 1)
141+
return get_object_from_id(allura_id)
142+
143+
144+
def get_object_from_id(node_id):
145+
classname, _id = node_id.split(':', 1)
142146
cls = Mapper.by_classname(classname).mapped_class
143147
try:
144148
_id = bson.ObjectId(_id)

0 commit comments

Comments
 (0)