We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1111959 commit 6ae6af6Copy full SHA for 6ae6af6
django_mongodb_backend/compiler.py
@@ -291,8 +291,9 @@ def pre_sql_setup(self, with_col_aliases=False):
291
for target, expr in self.query.annotation_select.items()
292
}
293
self.order_by_objs = [expr.replace_expressions(all_replacements) for expr, _ in order_by]
294
- where_ = self.get_where().replace_expressions(all_replacements)
295
- self.set_where(where_)
+ if (where := self.get_where()) and search_replacements:
+ where = where.replace_expressions(search_replacements)
296
+ self.set_where(where)
297
return extra_select, order_by, group_by
298
299
def execute_sql(
0 commit comments