Skip to content

feat(api): added support in the GroupManager to upload Group avatars - #1077

Merged
nejch merged 1 commit into
python-gitlab:masterfrom
cyberdruide:master
Apr 17, 2020
Merged

feat(api): added support in the GroupManager to upload Group avatars#1077
nejch merged 1 commit into
python-gitlab:masterfrom
cyberdruide:master

Conversation

@cyberdruide

Copy link
Copy Markdown
Contributor

Similar to the UserManager and ProjectManager the GroupManager now supports uploading avatar images. The GroupManager object was missing the ImageAttribute type.

The feature to upload avatars to groups was introduced in Gitlab 12.9.
See also https://docs.gitlab.com/ce/api/groups.html#new-group (Attribute "avatar")

@cyberdruide cyberdruide changed the title feat(api): Added support in the GroupManager to upload Group avatars. feat(api): added support in the GroupManager to upload Group avatars Apr 16, 2020

@nejch nejch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Flor1an-dev nice catch, thanks! Hard to keep up with the little details in the API sometimes it seems 😄

If you don't mind, we could also add this to the docs for Groups API like we do for Projects and users API (see example below)?

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

@cyberdruide

Copy link
Copy Markdown
Contributor Author

@nejch I've added the documentation as well :)

@nejch
nejch merged commit 7907e5a into python-gitlab:master Apr 17, 2020
@nejch

nejch commented Apr 17, 2020

Copy link
Copy Markdown
Member

@nejch I've added the documentation as well :)

Thanks again! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants