From c261875cf167e6858d052dc983fb0dcb03e3ea40 Mon Sep 17 00:00:00 2001 From: Christian Wenk Date: Thu, 21 Apr 2016 13:37:48 +0200 Subject: [PATCH] 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. --- gitlab/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitlab/__init__.py b/gitlab/__init__.py index 6c7519537..2f4b46466 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -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] @@ -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]