summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/gl_objects/projects.rst7
-rw-r--r--gitlab/v4/objects.py1
2 files changed, 8 insertions, 0 deletions
diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst
index 9e90c9b..f7bb4b3 100644
--- a/docs/gl_objects/projects.rst
+++ b/docs/gl_objects/projects.rst
@@ -84,6 +84,13 @@ Update a project::
project.snippets_enabled = 1
project.save()
+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()
+
Delete a project::
gl.projects.delete(project_id)
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 0f709fe..5637859 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -4463,6 +4463,7 @@ class ProjectManager(CRUDMixin, RESTManager):
"ci_config_path",
),
)
+ _types = {"avatar": types.ImageAttribute}
_list_filters = (
"search",
"owned",