diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2020-03-07 23:10:14 +0100 |
---|---|---|
committer | Nejc Habjan <hab.nejc@gmail.com> | 2020-03-07 23:10:14 +0100 |
commit | 99d959f74d06cca8df3f2d2b3a4709faba7799cb (patch) | |
tree | e4aa72b0438047cadb4b66a7ad5945c2083d0f71 /gitlab/mixins.py | |
parent | e5afb554bf4bcc28555bde4030f50558f175a53b (diff) | |
download | gitlab-99d959f74d06cca8df3f2d2b3a4709faba7799cb.tar.gz |
fix: do not require empty data dict for create()
Diffstat (limited to 'gitlab/mixins.py')
-rw-r--r-- | gitlab/mixins.py | 5 |
1 files changed, 4 insertions, 1 deletions
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 = {} |