Fix: quotas should be integers #302

This commit is contained in:
Rafa de la Torre 2016-11-08 18:46:58 +01:00
parent 6f9feb07a0
commit b00edf218a

View File

@ -88,11 +88,11 @@ class UserMetricsService:
redis_prefix = self.__parse_redis_prefix(key_prefix, entity_name,
service, metric, date)
score = self._redis_connection.zscore(redis_prefix, date.day)
aggregated_metric += score if score else 0
aggregated_metric += int(score) if score else 0
zero_padded_day = date.strftime(self.DAY_OF_MONTH_ZERO_PADDED)
if str(date.day) != zero_padded_day:
score = self._redis_connection.zscore(redis_prefix, zero_padded_day)
aggregated_metric += score if score else 0
aggregated_metric += int(score) if score else 0
return aggregated_metric