Skip to content

Commit c261875

Browse files
Remove 'next_url' from kwargs before passing it to the cls constructor.
The 'next_url' argument causes problems in the _construct_url method if it doesn't belong there. E.g. if you list all projects, change an attribute of a project and then try to save it, the _construct_url will use the 'next_url' from the list method and the save will fail.
1 parent 61bc24f commit c261875

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gitlab/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def _raw_list(self, path, cls, **kwargs):
281281
get_all_results = kwargs.get('all', False)
282282

283283
# Remove parameters from kwargs before passing it to constructor
284-
for key in ['all', 'page', 'per_page', 'sudo']:
284+
for key in ['all', 'page', 'per_page', 'sudo', 'next_url']:
285285
if key in cls_kwargs:
286286
del cls_kwargs[key]
287287

@@ -385,7 +385,7 @@ def list(self, obj_class, **kwargs):
385385
get_all_results = params.get('all', False)
386386

387387
# Remove parameters from kwargs before passing it to constructor
388-
for key in ['all', 'page', 'per_page', 'sudo']:
388+
for key in ['all', 'page', 'per_page', 'sudo', 'next_url']:
389389
if key in cls_kwargs:
390390
del cls_kwargs[key]
391391

0 commit comments

Comments
 (0)