This is an automated email from the ASF dual-hosted git repository. dill0wn pushed a commit to branch dw/8538 in repository https://gitbox.apache.org/repos/asf/allura.git
commit 85b1f56175939d7164099abeb42bb5c0faaaf4a7 Author: Dillon Walls <dillon.wa...@slashdotmedia.com> AuthorDate: Wed Mar 13 19:38:02 2024 +0000 [#8538] add new get_object_from_id timeline helper method which tries to find an object from an allura_id --- Allura/allura/model/timeline.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Allura/allura/model/timeline.py b/Allura/allura/model/timeline.py index 9048b6c1e..6c343bd6f 100644 --- a/Allura/allura/model/timeline.py +++ b/Allura/allura/model/timeline.py @@ -138,7 +138,11 @@ def get_activity_object(activity_object_dict): allura_id = get_allura_id(activity_object_dict) if not allura_id: return None - classname, _id = allura_id.split(':', 1) + return get_object_from_id(allura_id) + + +def get_object_from_id(node_id): + classname, _id = node_id.split(':', 1) cls = Mapper.by_classname(classname).mapped_class try: _id = bson.ObjectId(_id)