From 81533963537f57f2ee54786de61a54377eb7b32e Mon Sep 17 00:00:00 2001 From: Abdul Rehman Date: Wed, 3 Dec 2025 15:33:36 +0500 Subject: [PATCH] fix: Fix Mongo contents queries when content_type is unset --- forum/backends/mongodb/contents.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forum/backends/mongodb/contents.py b/forum/backends/mongodb/contents.py index 99d5c264..489ccd2a 100644 --- a/forum/backends/mongodb/contents.py +++ b/forum/backends/mongodb/contents.py @@ -101,7 +101,8 @@ def override_query(self, query: dict[str, Any]) -> dict[str, Any]: """ Override the query with the _type field. """ - query = {**query, "_type": self.content_type} + if self.content_type: + query = {**query, "_type": self.content_type} return super().override_query(query) def get_list(self, **kwargs: Any) -> Cursor[dict[str, Any]]: