| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 09ef68f commit 71c8750
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,7 @@ Version 0.4 | |||
| 4 | 4 | * Allow to get a project commit (GitLab 6.1) | |
| 5 | 5 | * ProjectMergeRequest: fix Note() method | |
| 6 | 6 | * Gitlab 6.1 methods: diff, blob (commit), tree, blob (project) | |
| 7 | + * Add support for Gitlab 6.1 group members | ||
| 7 | 8 | ||
| 8 | 9 | Version 0.3 | |
| 9 | 10 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,7 +187,7 @@ def list(self, obj_class, **kwargs): | |||
| 187 | 187 | cls = obj_class | |
| 188 | 188 | if obj_class._returnClass: | |
| 189 | 189 | cls = obj_class._returnClass | |
| 190 | - l = [cls(self, item) for item in r.json()] | ||
| 190 | + l = [cls(self, item) for item in r.json() if item is not None] | ||
| 191 | 191 | if kwargs: | |
| 192 | 192 | for k, v in kwargs.items(): | |
| 193 | 193 | if k in ('page', 'per_page'): | |
@@ -571,12 +571,26 @@ def Key(self, id=None, **kwargs): | |||
| 571 | 571 | return CurrentUserKey(self.gitlab, id) | |
| 572 | 572 | ||
| 573 | 573 | ||
| 574 | + class GroupMember(GitlabObject): | ||
| 575 | + _url = '/groups/%(group_id)s/members' | ||
| 576 | + canGet = False | ||
| 577 | + canUpdate = False | ||
| 578 | + requiredCreateAttrs = ['group_id', 'user_id', 'access_level'] | ||
| 579 | + requiredDeleteAttrs = ['group_id', 'user_id'] | ||
| 580 | + shortPrintAttr = 'username' | ||
| 581 | + | ||
| 582 | + | ||
| 574 | 583 | class Group(GitlabObject): | |
| 575 | 584 | _url = '/groups' | |
| 576 | 585 | _constructorTypes = {'projects': 'Project'} | |
| 577 | 586 | requiredCreateAttrs = ['name', 'path'] | |
| 578 | 587 | shortPrintAttr = 'name' | |
| 579 | 588 | ||
| 589 | + def Member(self, id=None, **kwargs): | ||
| 590 | + return self._getListOrObject(GroupMember, id, | ||
| 591 | + group_id=self.id, | ||
| 592 | + **kwargs) | ||
| 593 | + | ||
| 580 | 594 | def transfer_project(self, id): | |
| 581 | 595 | url = '/groups/%d/projects/%d' % (self.id, id) | |
| 582 | 596 | r = self.gitlab.rawPost(url, None) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments