diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2016-03-19 15:28:06 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2016-03-19 15:28:26 +0100 |
commit | f8528cce8d79b13e90e1f87b56c8cdbe30b2067e (patch) | |
tree | 750316bb11940aee27e8f7df87d7517f2bcab864 | |
parent | e48e4aca9650b241d1f1e038fdcab125b7c95656 (diff) | |
download | gitlab-f8528cce8d79b13e90e1f87b56c8cdbe30b2067e.tar.gz |
Gitlab.update(): use the proper attributes if defined
-rw-r--r-- | gitlab/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index ef39cd5..693621c 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -567,8 +567,11 @@ class Gitlab(object): params = obj.__dict__.copy() params.update(kwargs) missing = [] - for k in itertools.chain(obj.requiredUrlAttrs, - obj.requiredCreateAttrs): + if obj.requiredUpdateAttrs or obj.optionalUpdateAttrs: + required_attrs = obj.requiredUpdateAttrs + else: + required_attrs = obj.requiredCreateAttrs + for k in itertools.chain(obj.requiredUrlAttrs, required_attrs): if k not in params: missing.append(k) if missing: |