Skip to content

Commit f8528cc

Browse files
author
Gauvain Pocentek
committed
Gitlab.update(): use the proper attributes if defined
1 parent e48e4ac commit f8528cc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gitlab/__init__.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,11 @@ def update(self, obj, **kwargs):
567567
params = obj.__dict__.copy()
568568
params.update(kwargs)
569569
missing = []
570-
for k in itertools.chain(obj.requiredUrlAttrs,
571-
obj.requiredCreateAttrs):
570+
if obj.requiredUpdateAttrs or obj.optionalUpdateAttrs:
571+
required_attrs = obj.requiredUpdateAttrs
572+
else:
573+
required_attrs = obj.requiredCreateAttrs
574+
for k in itertools.chain(obj.requiredUrlAttrs, required_attrs):
572575
if k not in params:
573576
missing.append(k)
574577
if missing:

0 commit comments

Comments
 (0)