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.

realm_export: Use .count(), instead of len().

Alex Vandiver5990835bc181
diff --git a/zerver/views/realm_export.py b/zerver/views/realm_export.py
index 9ecda8b1b43..28614e1140d 100644
--- a/zerver/views/realm_export.py
+++ b/zerver/views/realm_export.py
@@ -39,8 +39,8 @@ def export_realm(request: HttpRequest, user: UserProfile) -> HttpResponse:
event_time_delta = event_time - timedelta(days=7)
limit_check = RealmAuditLog.objects.filter(
realm=realm, event_type=event_type, event_time__gte=event_time_delta
- )
- if len(limit_check) >= EXPORT_LIMIT:
+ ).count()
+ if limit_check >= EXPORT_LIMIT:
raise JsonableError(_("Exceeded rate limit."))
# The RealmCount analytics table lets us efficiently get an