mirror of https://github.com/zulip/zulip.git
analytics: Add `at_risk_count` to Totals row in realm summary.
This fixes reading from an unset value in realm_summary_table, which is fine with the Django template engine but will be problematic with jinja2.
This commit is contained in:
parent
4620cd8483
commit
6a0c7fec72
|
@ -243,10 +243,12 @@ def realm_summary_table(realm_minutes):
|
|||
total_active_user_count = 0
|
||||
total_user_profile_count = 0
|
||||
total_bot_count = 0
|
||||
total_at_risk_count = 0
|
||||
for row in rows:
|
||||
total_active_user_count += int(row['active_user_count'])
|
||||
total_user_profile_count += int(row['user_profile_count'])
|
||||
total_bot_count += int(row['bot_count'])
|
||||
total_at_risk_count += int(row['at_risk_count'])
|
||||
|
||||
|
||||
rows.append(dict(
|
||||
|
@ -254,7 +256,8 @@ def realm_summary_table(realm_minutes):
|
|||
active_user_count=total_active_user_count,
|
||||
user_profile_count=total_user_profile_count,
|
||||
bot_count=total_bot_count,
|
||||
hours=int(total_hours)
|
||||
hours=int(total_hours),
|
||||
at_risk_count=total_at_risk_count,
|
||||
))
|
||||
|
||||
content = loader.render_to_string(
|
||||
|
|
Loading…
Reference in New Issue