summaryrefslogtreecommitdiff
path: root/gitlab/mixins.py
diff options
context:
space:
mode:
authorEric Sabouraud <esabouraud@users.noreply.github.com>2018-06-11 21:23:57 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2018-06-11 21:23:57 +0200
commit2c22a34ef68da190520fac4b326144061898e0cc (patch)
treecb33bd3aa0c7017651f8c3c665baa5ab85f320e9 /gitlab/mixins.py
parent617aa64c8066ace4be4bbc3f510f27d3a0519daf (diff)
downloadgitlab-2c22a34ef68da190520fac4b326144061898e0cc.tar.gz
Add project push rules configuration (#520)
Diffstat (limited to 'gitlab/mixins.py')
-rw-r--r--gitlab/mixins.py11
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)