Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
do_increment_logging_stat: Rename zerver_object argument.
Mateusz Manderac4fbb6319b79
diff --git a/analytics/lib/counts.py b/analytics/lib/counts.pyindex c61137be8d9..373b78b6e52 100644--- a/analytics/lib/counts.py+++ b/analytics/lib/counts.py@@ -293,7 +293,7 @@ def do_aggregate_to_summary_table(# called from zerver.actions; should not throw any errorsdef do_increment_logging_stat(- zerver_object: Union[Realm, UserProfile, Stream],+ model_object_for_bucket: Union[Realm, UserProfile, Stream],stat: CountStat,subgroup: Optional[Union[str, int, bool]],event_time: datetime,@@ -304,14 +304,14 @@ def do_increment_logging_stat(table = stat.data_collector.output_tableif table == RealmCount:- assert isinstance(zerver_object, Realm)- id_args: Dict[str, Union[Realm, UserProfile, Stream]] = {"realm": zerver_object}+ assert isinstance(model_object_for_bucket, Realm)+ id_args: Dict[str, Union[Realm, UserProfile, Stream]] = {"realm": model_object_for_bucket}elif table == UserCount:- assert isinstance(zerver_object, UserProfile)- id_args = {"realm": zerver_object.realm, "user": zerver_object}+ assert isinstance(model_object_for_bucket, UserProfile)+ id_args = {"realm": model_object_for_bucket.realm, "user": model_object_for_bucket}else: # StreamCount- assert isinstance(zerver_object, Stream)- id_args = {"realm": zerver_object.realm, "stream": zerver_object}+ assert isinstance(model_object_for_bucket, Stream)+ id_args = {"realm": model_object_for_bucket.realm, "stream": model_object_for_bucket}if stat.frequency == CountStat.DAY:end_time = ceiling_to_day(event_time)