Skip to content

Commit 7907e5a

Browse files
authored
Merge pull request #1077 from Flor1an-dev/master
feat(api): added support in the GroupManager to upload Group avatars
2 parents dad505c + 28eb7ea commit 7907e5a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/gl_objects/groups.rst

+7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ Update a group::
6161
group.description = 'My awesome group'
6262
group.save()
6363

64+
Set the avatar image for a group::
65+
66+
# the avatar image can be passed as data (content of the file) or as a file
67+
# object opened in binary mode
68+
group.avatar = open('path/to/file.png', 'rb')
69+
group.save()
70+
6471
Remove a group::
6572

6673
gl.groups.delete(group_id)

gitlab/v4/objects.py

+1
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,7 @@ class GroupManager(CRUDMixin, RESTManager):
15131513
"default_branch_protection",
15141514
),
15151515
)
1516+
_types = {"avatar": types.ImageAttribute}
15161517

15171518
@exc.on_http_error(exc.GitlabImportError)
15181519
def import_group(self, file, path, name, parent_id=None, **kwargs):

0 commit comments

Comments
 (0)