summaryrefslogtreecommitdiff
path: root/gitlab/objects.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-01-21 16:54:16 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2017-01-21 17:04:00 +0100
commitee666fd57e5cb100b6e195bb74228ac242d8932a (patch)
tree58ad29ae3a7f0c113a76f2b04e0767445f3e83d5 /gitlab/objects.py
parent04435e1b13166fb45216c494f3af4d9bdb76bcaf (diff)
downloadgitlab-ee666fd57e5cb100b6e195bb74228ac242d8932a.tar.gz
Add support for commit creation
Fixes #206
Diffstat (limited to 'gitlab/objects.py')
-rw-r--r--gitlab/objects.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 3f09aad..8c35911 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -223,7 +223,8 @@ class GitlabObject(object):
if hasattr(self, attribute):
value = getattr(self, attribute)
if isinstance(value, list):
- value = ",".join(value)
+ if value and isinstance(value[0], six.string_types):
+ value = ",".join(value)
if attribute == 'sudo':
value = str(value)
data[attribute] = value
@@ -1278,8 +1279,9 @@ class ProjectCommit(GitlabObject):
_url = '/projects/%(project_id)s/repository/commits'
canDelete = False
canUpdate = False
- canCreate = False
requiredUrlAttrs = ['project_id']
+ requiredCreateAttrs = ['branch_name', 'commit_message', 'actions']
+ optionalCreateAttrs = ['author_email', 'author_name']
shortPrintAttr = 'title'
managers = (
('comments', ProjectCommitCommentManager,