Skip to content

Commit

Permalink
Gitlab.update(): use the proper attributes if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauvain Pocentek committed Mar 19, 2016
1 parent e48e4ac commit f8528cc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gitlab/__init__.py
Expand Up @@ -567,8 +567,11 @@ def update(self, obj, **kwargs):
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:
Expand Down

0 comments on commit f8528cc

Please sign in to comment.