This is an automated email from the ASF dual-hosted git repository. brondsem pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/master by this push: new 9ebd2cba3 [#8538] add new get_object_from_id timeline helper method which tries to find an object from an allura_id 9ebd2cba3 is described below commit 9ebd2cba32e5badafe1678c6ddad9816024f16b3 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)