Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf2223e2

Browse files
author
Gauvain Pocentek
committed
time_stats(): use an existing attribute if available
A time_stats attribute is returned by GitLab when fetching issues andmerge requests (on reasonably recent GitLab versions). Use this infoinstead of making a new API call if possible.Fixes#510
1 parentf8e6b13 commitf2223e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎gitlab/mixins.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,11 @@ def time_stats(self, **kwargs):
477477
GitlabAuthenticationError: If authentication is not correct
478478
GitlabTimeTrackingError: If the time tracking update cannot be done
479479
"""
480+
# Use the existing time_stats attribute if it exist, otherwise make an
481+
# API call
482+
if'time_stats'inself.attributes:
483+
returnself.attributes['time_stats']
484+
480485
path='%s/%s/time_stats'% (self.manager.path,self.get_id())
481486
returnself.manager.gitlab.http_get(path,**kwargs)
482487

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp