diff options
Diffstat (limited to 'gitlab/mixins.py')
-rw-r--r-- | gitlab/mixins.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gitlab/mixins.py b/gitlab/mixins.py index 59fcf1b..bd4d8c7 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -66,6 +66,8 @@ class GetWithoutIdMixin(object): GitlabGetError: If the server cannot perform the request """ server_data = self.gitlab.http_get(self.path, **kwargs) + if server_data is None: + return None return self._obj_cls(self, server_data) @@ -317,9 +319,12 @@ class DeleteMixin(object): GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server cannot perform the request """ - if not isinstance(id, int): - id = id.replace('/', '%2F') - path = '%s/%s' % (self.path, id) + if id is None: + path = self.path + else: + if not isinstance(id, int): + id = id.replace('/', '%2F') + path = '%s/%s' % (self.path, id) self.gitlab.http_delete(path, **kwargs) |