This is an automated email from the ASF dual-hosted git repository.
dill0wn pushed a commit to branch dw/8565
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/dw/8565 by this push:
new 9925d31cf fix import for pymongo4
9925d31cf is described below
commit 9925d31cf7182ed35b4adfeccc5c0f552cf0416a
Author: Dillon Walls <[email protected]>
AuthorDate: Wed Jul 17 14:47:21 2024 -0400
fix import for pymongo4
---
Allura/allura/lib/helpers.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index c6fc9fbae..580b4ba73 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -52,7 +52,10 @@ from formencode.validators import FancyValidator
from dateutil.parser import parse
from bson import ObjectId
from paste.deploy import appconfig
-from pymongo.errors import InvalidId
+try:
+ from pymongo.errors import InvalidId
+except ImportError:
+ from bson.errors import InvalidId
from contextlib import contextmanager
from tg import tmpl_context as c, app_globals as g
from tg import response, request