Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
lookups: Return as_sql params as tuple.
Anders Kaseorg94aa1a00fffd
diff --git a/zerver/models/lookups.py b/zerver/models/lookups.pyindex c5f58f4fea3..70bb7dc70ba 100644--- a/zerver/models/lookups.py+++ b/zerver/models/lookups.py@@ -11,10 +11,10 @@ class AndZero(models.Lookup[int]):@overridedef as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper- ) -> tuple[str, list[str | int]]: # nocoverage # currently only used in migrations+ ) -> tuple[str, tuple[str | int, ...]]: # nocoverage # currently only used in migrationslhs, lhs_params = self.process_lhs(compiler, connection)rhs, rhs_params = self.process_rhs(compiler, connection)- return f"{lhs} & {rhs} = 0", [*lhs_params, *rhs_params]+ return f"{lhs} & {rhs} = 0", (*lhs_params, *rhs_params)@models.Field.register_lookup@@ -24,7 +24,7 @@ class AndNonZero(models.Lookup[int]):@overridedef as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper- ) -> tuple[str, list[str | int]]: # nocoverage # currently only used in migrations+ ) -> tuple[str, tuple[str | int, ...]]: # nocoverage # currently only used in migrationslhs, lhs_params = self.process_lhs(compiler, connection)rhs, rhs_params = self.process_rhs(compiler, connection)- return f"{lhs} & {rhs} != 0", [*lhs_params, *rhs_params]+ return f"{lhs} & {rhs} != 0", (*lhs_params, *rhs_params)