summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-01-30 17:45:34 +0100
committerGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-01-30 17:45:34 +0100
commit141f21a9982e3de54e8c8d6a5138cc08a91e1492 (patch)
tree5197ae460c30aa07f1e17bf9a5a0cb38ea4e79c5 /gitlab
parent00ab7d00a553e68eea5668dbf455404925fef6e0 (diff)
downloadgitlab-141f21a9982e3de54e8c8d6a5138cc08a91e1492.tar.gz
Fix project update
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/cli.py4
-rw-r--r--gitlab/objects.py9
2 files changed, 7 insertions, 6 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py
index 7fa176c..838bf07 100644
--- a/gitlab/cli.py
+++ b/gitlab/cli.py
@@ -106,14 +106,14 @@ def _populate_sub_parser_by_class(cls, sub_parser):
required=True)
attrs = (cls.requiredUpdateAttrs
- if cls.requiredUpdateAttrs is not None
+ if (cls.requiredUpdateAttrs or cls.optionalUpdateAttrs)
else cls.requiredCreateAttrs)
[sub_parser_action.add_argument("--%s" % x.replace('_', '-'),
required=True)
for x in attrs if x != cls.idAttr]
attrs = (cls.optionalUpdateAttrs
- if cls.optionalUpdateAttrs is not None
+ if (cls.requiredUpdateAttrs or cls.optionalUpdateAttrs)
else cls.optionalCreateAttrs)
[sub_parser_action.add_argument("--%s" % x.replace('_', '-'),
required=False)
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 28530a0..ec66e17 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -728,9 +728,6 @@ class ProjectCommitStatus(GitlabObject):
requiredUrlAttrs = ['project_id', 'commit_id']
requiredCreateAttrs = ['state']
optionalCreateAttrs = ['description', 'name', 'ref', 'target_url']
- requiredGetAttrs = []
- requiredUpdateAttrs = []
- requiredDeleteAttrs = []
class ProjectCommitStatusManager(BaseManager):
@@ -1079,11 +1076,15 @@ class Project(GitlabObject):
_url = '/projects'
_constructorTypes = {'owner': 'User', 'namespace': 'Group'}
requiredCreateAttrs = ['name']
- requiredUpdateAttrs = []
optionalCreateAttrs = ['default_branch', 'issues_enabled', 'wall_enabled',
'merge_requests_enabled', 'wiki_enabled',
'snippets_enabled', 'public', 'visibility_level',
'namespace_id', 'description', 'path', 'import_url']
+ optionalUpdateAttrs = ['name', 'default_branch', 'issues_enabled',
+ 'wall_enabled', 'merge_requests_enabled',
+ 'wiki_enabled', 'snippets_enabled', 'public',
+ 'visibility_level', 'namespace_id', 'description',
+ 'path', 'import_url']
shortPrintAttr = 'path'
managers = [
('branches', ProjectBranchManager, [('project_id', 'id')]),