diff options
Diffstat (limited to 'gitlab/mixins.py')
-rw-r--r-- | gitlab/mixins.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gitlab/mixins.py b/gitlab/mixins.py index 05e31c0..966a647 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -477,6 +477,11 @@ class TimeTrackingMixin(object): GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the time tracking update cannot be done """ + # Use the existing time_stats attribute if it exist, otherwise make an + # API call + if 'time_stats' in self.attributes: + return self.attributes['time_stats'] + path = '%s/%s/time_stats' % (self.manager.path, self.get_id()) return self.manager.gitlab.http_get(path, **kwargs) |