This is an automated email from the ASF dual-hosted git repository.

kentontaylor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 6f8ede9b23f3950056371d910a1bada72228b908
Author: Dave Brondsema <[email protected]>
AuthorDate: Thu Mar 6 11:58:41 2025 -0500

    ensure_index: make deduping work on nested fields like "foo.bar.baz"
---
 Allura/allura/command/show_models.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Allura/allura/command/show_models.py 
b/Allura/allura/command/show_models.py
index 8d479bb8e..54555fc32 100644
--- a/Allura/allura/command/show_models.py
+++ b/Allura/allura/command/show_models.py
@@ -26,6 +26,7 @@
 
 from ming.odm import mapper, session, Mapper
 from ming.odm.declarative import MappedClass
+import ming.mim
 
 from allura.tasks.index_tasks import add_artifacts
 from allura.lib.exceptions import CompoundError
@@ -362,7 +363,7 @@ def _remove_dupes(self, collection, spec, index_options: 
dict):
         q = collection.find(query, projection=fields).sort(spec)
 
         def keyfunc(doc):
-            return tuple(doc.get(f, None) for f in fields)
+            return tuple(list(ming.mim._lookup(doc, f, None)) for f in fields)
         dupes = []
         for key, doc_iter in groupby(q, key=keyfunc):
             docs = list(doc_iter)

Reply via email to