Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

narrow: Fix empty `and_` depricated warning.

Aman Agrawal09e0ec35e117
diff --git a/zerver/lib/narrow.py b/zerver/lib/narrow.py
index 7cbd6f41be6..9e58176f4b2 100644
--- a/zerver/lib/narrow.py
+++ b/zerver/lib/narrow.py
@@ -374,7 +374,9 @@ class NarrowBuilder:
conditions = exclude_muting_conditions(
self.user_profile, [NarrowParameter(operator="in", operand="home")]
)
- return query.where(maybe_negate(and_(*conditions)))
+ if conditions:
+ return query.where(maybe_negate(and_(*conditions)))
+ return query # nocoverage
elif operand == "all":
return query