| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ad35482 commit 397d677
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -85,3 +85,7 @@ | |||
| 85 | 85 | # project issue reset time spent | |
| 86 | 86 | issue.reset_time_spent() | |
| 87 | 87 | # end project issue reset time spent | |
| 88 | + | ||
| 89 | + # project issue useragent | ||
| 90 | + detail = issue.user_agent_detail() | ||
| 91 | + # end project issue useragent | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -176,3 +176,8 @@ Reset spent time for an issue: | |||
| 176 | 176 | :start-after: # project issue reset time spent | |
| 177 | 177 | :end-before: # end project issue reset time spent | |
| 178 | 178 | ||
| 179 | + Get user agent detail for the issue (admin only): | ||
| 180 | + | ||
| 181 | + .. literalinclude:: issues.py | ||
| 182 | + :start-after: # project issue useragent | ||
| 183 | + :end-before: # end project issue useragent | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1128,6 +1128,21 @@ class ProjectIssue(SubscribableMixin, TodoMixin, TimeTrackingMixin, SaveMixin, | |||
| 1128 | 1128 | _id_attr = 'iid' | |
| 1129 | 1129 | _managers = (('notes', 'ProjectIssueNoteManager'), ) | |
| 1130 | 1130 | ||
| 1131 | + @cli.register_custom_action('ProjectIssue') | ||
| 1132 | + @exc.on_http_error(exc.GitlabUpdateError) | ||
| 1133 | + def user_agent_detail(self, **kwargs): | ||
| 1134 | + """Get user agent detail. | ||
| 1135 | + | ||
| 1136 | + Args: | ||
| 1137 | + **kwargs: Extra options to send to the server (e.g. sudo) | ||
| 1138 | + | ||
| 1139 | + Raises: | ||
| 1140 | + GitlabAuthenticationError: If authentication is not correct | ||
| 1141 | + GitlabGetError: If the detail could not be retrieved | ||
| 1142 | + """ | ||
| 1143 | + path = '%s/%s/user_agent_detail' % (self.manager.path, self.get_id()) | ||
| 1144 | + return self.manager.gitlab.http_get(path, **kwargs) | ||
| 1145 | + | ||
| 1131 | 1146 | @cli.register_custom_action('ProjectIssue', ('to_project_id',)) | |
| 1132 | 1147 | @exc.on_http_error(exc.GitlabUpdateError) | |
| 1133 | 1148 | def move(self, to_project_id, **kwargs): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -435,6 +435,7 @@ | |||
| 435 | 435 | assert(len(issue1.notes.list()) == 1) | |
| 436 | 436 | note.delete() | |
| 437 | 437 | assert(len(issue1.notes.list()) == 0) | |
| 438 | + assert(isinstance(issue1.user_agent_detail(), dict)) | ||
| 438 | 439 | ||
| 439 | 440 | # tags | |
| 440 | 441 | tag1 = admin_project.tags.create({'tag_name': 'v1.0', 'ref': 'master'}) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments