Skip to content

Commit

Permalink
Remove 'next_url' from kwargs before passing it to the cls constructor.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chrwen-omicron committed Apr 21, 2016
1 parent 61bc24f commit c261875
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gitlab/__init__.py
Expand Up @@ -281,7 +281,7 @@ def _raw_list(self, path, cls, **kwargs):
get_all_results = kwargs.get('all', False)

# Remove parameters from kwargs before passing it to constructor
for key in ['all', 'page', 'per_page', 'sudo']:
for key in ['all', 'page', 'per_page', 'sudo', 'next_url']:
if key in cls_kwargs:
del cls_kwargs[key]

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

# Remove parameters from kwargs before passing it to constructor
for key in ['all', 'page', 'per_page', 'sudo']:
for key in ['all', 'page', 'per_page', 'sudo', 'next_url']:
if key in cls_kwargs:
del cls_kwargs[key]

Expand Down

0 comments on commit c261875

Please sign in to comment.