mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 08:56:10 +00:00
activity: Consistently define "user" as non-deactivated, non-bot.
This commit is contained in:
@@ -316,6 +316,9 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str:
|
|||||||
JOIN zerver_userprofile up
|
JOIN zerver_userprofile up
|
||||||
ON up.id = ua.user_profile_id
|
ON up.id = ua.user_profile_id
|
||||||
WHERE
|
WHERE
|
||||||
|
up.is_active
|
||||||
|
AND (not up.is_bot)
|
||||||
|
AND
|
||||||
query in (
|
query in (
|
||||||
'/json/send_message',
|
'/json/send_message',
|
||||||
'send_message_backend',
|
'send_message_backend',
|
||||||
@@ -326,8 +329,6 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str:
|
|||||||
)
|
)
|
||||||
AND
|
AND
|
||||||
last_visit > now() - interval '1 day'
|
last_visit > now() - interval '1 day'
|
||||||
AND
|
|
||||||
not is_bot
|
|
||||||
GROUP BY realm_id
|
GROUP BY realm_id
|
||||||
) user_counts
|
) user_counts
|
||||||
ON user_counts.realm_id = realm.id
|
ON user_counts.realm_id = realm.id
|
||||||
@@ -368,6 +369,10 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str:
|
|||||||
JOIN zerver_userprofile up
|
JOIN zerver_userprofile up
|
||||||
ON up.id = ua.user_profile_id
|
ON up.id = ua.user_profile_id
|
||||||
WHERE
|
WHERE
|
||||||
|
up.realm_id = realm.id
|
||||||
|
AND up.is_active
|
||||||
|
AND (not up.is_bot)
|
||||||
|
AND
|
||||||
query in (
|
query in (
|
||||||
'/json/send_message',
|
'/json/send_message',
|
||||||
'/api/v1/send_message',
|
'/api/v1/send_message',
|
||||||
@@ -376,8 +381,6 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str:
|
|||||||
'/json/users/me/pointer',
|
'/json/users/me/pointer',
|
||||||
'update_pointer_backend'
|
'update_pointer_backend'
|
||||||
)
|
)
|
||||||
AND
|
|
||||||
up.realm_id = realm.id
|
|
||||||
AND
|
AND
|
||||||
last_visit > now() - interval '2 week'
|
last_visit > now() - interval '2 week'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user