Skip to content

Commit

Permalink
feat(api): added support in the GroupManager to upload Group avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
Flor1an-dev authored and Florian Hartmann committed Apr 17, 2020
1 parent 70cefe4 commit 28eb7ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/gl_objects/groups.rst
Expand Up @@ -61,6 +61,13 @@ Update a group::
group.description = 'My awesome group'
group.save()

Set the avatar image for a group::

# the avatar image can be passed as data (content of the file) or as a file
# object opened in binary mode
group.avatar = open('path/to/file.png', 'rb')
group.save()

Remove a group::

gl.groups.delete(group_id)
Expand Down
1 change: 1 addition & 0 deletions gitlab/v4/objects.py
Expand Up @@ -1513,6 +1513,7 @@ class GroupManager(CRUDMixin, RESTManager):
"default_branch_protection",
),
)
_types = {"avatar": types.ImageAttribute}

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

0 comments on commit 28eb7ea

Please sign in to comment.