Add User Profile Count to General tab on /activity.

(imported from commit 231b3d6f2fe48f511d6387e25c2fea5e3accc186)
This commit is contained in:
Steve Howell 2013-09-26 15:39:46 -04:00
parent b84fb319ee
commit 902185f8fb
2 changed files with 14 additions and 1 deletions

View File

@ -6,6 +6,7 @@
<tr>
<th>Domain</th>
<th>Active User Count</th>
<th>User Profile Count</th>
</tr>
</thead>
@ -25,6 +26,11 @@
{{ row.active_user_count }}
</td>
{# User Profile Count #}
<td class="number">
{{ row.user_profile_count }}
</td>
</tr>
{% endfor %}
</tbody>

View File

@ -1845,7 +1845,14 @@ def realm_summary_table():
query = '''
SELECT
realm.domain,
coalesce(user_counts.active_user_count, 0) active_user_count
coalesce(user_counts.active_user_count, 0) active_user_count,
(
SELECT
count(*)
FROM zerver_userprofile up
WHERE up.realm_id = realm.id
AND is_active
) user_profile_count
FROM zerver_realm realm
LEFT OUTER JOIN
(