Skip to content

Commit 558ace9

Browse files
author
Ravan Scafi
committed
fix(projects): avatar uploading for projects
1 parent e8a3585 commit 558ace9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/gl_objects/projects.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ Update a project::
8484
project.snippets_enabled = 1
8585
project.save()
8686

87+
Set the avatar image for a project::
88+
89+
# the avatar image can be passed as data (content of the file) or as a file
90+
# object opened in binary mode
91+
project.avatar = open('path/to/file.png', 'rb')
92+
project.save()
93+
8794
Delete a project::
8895

8996
gl.projects.delete(project_id)

gitlab/v4/objects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4463,6 +4463,7 @@ class ProjectManager(CRUDMixin, RESTManager):
44634463
"ci_config_path",
44644464
),
44654465
)
4466+
_types = {"avatar": types.ImageAttribute}
44664467
_list_filters = (
44674468
"search",
44684469
"owned",

0 commit comments

Comments
 (0)