Skip to content

Commit

Permalink
fix: remove null values from features POST data, because it fails
Browse files Browse the repository at this point in the history
with HTTP 500
  • Loading branch information
filipowm committed Feb 7, 2020
1 parent 7f192b4 commit 1ec1816
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gitlab/utils.py
Expand Up @@ -55,3 +55,7 @@ def sanitized_url(url):
parsed = urlparse(url)
new_path = parsed.path.replace(".", "%2E")
return parsed._replace(path=new_path).geturl()


def remove_none_from_dict(data):
return {k: v for k, v in data.items() if v is not None}
1 change: 1 addition & 0 deletions gitlab/v4/objects.py
Expand Up @@ -760,6 +760,7 @@ def set(
"group": group,
"project": project,
}
data = utils.remove_none_from_dict(data)
server_data = self.gitlab.http_post(path, post_data=data, **kwargs)
return self._obj_cls(self, server_data)

Expand Down

0 comments on commit 1ec1816

Please sign in to comment.