mirror of https://github.com/zulip/zulip.git
stream settings: Fix brand new streams showing 0 weekly traffic.
A stream created in the last few hours likely won't be in StreamCount (since that gets updated once a day), and hence won't be in the recent_traffic dict. However, get_average_weekly_stream_traffic should be None in this case, not 0.
This commit is contained in:
parent
0573c17819
commit
e37b5dce79
|
@ -3969,7 +3969,7 @@ def get_average_weekly_stream_traffic(stream_id: int, stream_date_created: datet
|
|||
try:
|
||||
stream_traffic = recent_traffic[stream_id]
|
||||
except KeyError:
|
||||
return 0
|
||||
stream_traffic = 0
|
||||
|
||||
stream_age = (timezone_now() - stream_date_created).days
|
||||
|
||||
|
|
Loading…
Reference in New Issue