From 99d959f74d06cca8df3f2d2b3a4709faba7799cb Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Sat, 7 Mar 2020 23:10:14 +0100 Subject: fix: do not require empty data dict for create() --- gitlab/mixins.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gitlab/mixins.py') diff --git a/gitlab/mixins.py b/gitlab/mixins.py index 8544499..dde11d0 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -170,7 +170,7 @@ class CreateMixin(object): return getattr(self, "_create_attrs", (tuple(), tuple())) @exc.on_http_error(exc.GitlabCreateError) - def create(self, data, **kwargs): + def create(self, data=None, **kwargs): """Create a new object. Args: @@ -186,6 +186,9 @@ class CreateMixin(object): GitlabAuthenticationError: If authentication is not correct GitlabCreateError: If the server cannot perform the request """ + if data is None: + data = {} + self._check_missing_create_attrs(data) files = {} -- cgit v1.2.1