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.

bot_storage: Use queryset.count() instead of len(queryset).

Tim Abbott962e2b61eb82
diff --git a/zerver/lib/bot_storage.py b/zerver/lib/bot_storage.py
index 420f7768c9a..a09dc8dfde7 100644
--- a/zerver/lib/bot_storage.py
+++ b/zerver/lib/bot_storage.py
@@ -54,7 +54,7 @@ def set_bot_storage(bot_profile: UserProfile, entries: list[tuple[str, str]]) ->
def remove_bot_storage(bot_profile: UserProfile, keys: list[str]) -> None:
queryset = BotStorageData.objects.filter(bot_profile=bot_profile, key__in=keys)
- if len(queryset) < len(keys):
+ if queryset.count() < len(keys):
raise StateError("Key does not exist.")
queryset.delete()