mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
analytics: Fix cnts variable reuse with different type.
Found using mypy.
This commit is contained in:
@@ -86,9 +86,9 @@ def get_realm_day_counts():
|
||||
|
||||
result = {}
|
||||
for domain in counts:
|
||||
cnts = [counts[domain].get(age, 0) for age in range(8)]
|
||||
min_cnt = min(cnts)
|
||||
max_cnt = max(cnts)
|
||||
raw_cnts = [counts[domain].get(age, 0) for age in range(8)]
|
||||
min_cnt = min(raw_cnts)
|
||||
max_cnt = max(raw_cnts)
|
||||
|
||||
def format_count(cnt):
|
||||
if cnt == min_cnt:
|
||||
@@ -100,7 +100,7 @@ def get_realm_day_counts():
|
||||
|
||||
return '<td class="number %s">%s</td>' % (good_bad, cnt)
|
||||
|
||||
cnts = ''.join(map(format_count, cnts))
|
||||
cnts = ''.join(map(format_count, raw_cnts))
|
||||
result[domain] = dict(cnts=cnts)
|
||||
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user