mirror of https://github.com/zulip/zulip.git
realm_export: Use .count(), instead of len().
This commit is contained in:
parent
29e32c3977
commit
5990835bc1
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue