diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-02-10 00:55:50 +0100 |
---|---|---|
committer | John Villalovos <john@sodarock.com> | 2022-02-10 10:21:30 -0800 |
commit | 0717517212b616cfd52cfd38dd5c587ff8f9c47c (patch) | |
tree | 042364f1ba6dda6a4b7e497cbdd171e4c01ee610 /gitlab/mixins.py | |
parent | 5beda3baae97474f2625131c3d6e5799e75d546a (diff) | |
download | gitlab-0717517212b616cfd52cfd38dd5c587ff8f9c47c.tar.gz |
feat(mixins): allow deleting resources without IDs
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 c6d1f7a..1a3ff4d 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -463,7 +463,7 @@ class DeleteMixin(_RestManagerBase): gitlab: gitlab.Gitlab @exc.on_http_error(exc.GitlabDeleteError) - def delete(self, id: Union[str, int], **kwargs: Any) -> None: + def delete(self, id: Optional[Union[str, int]] = None, **kwargs: Any) -> None: """Delete an object on the server. Args: @@ -478,6 +478,9 @@ class DeleteMixin(_RestManagerBase): path = self.path else: path = f"{self.path}/{utils.EncodedId(id)}" + + if TYPE_CHECKING: + assert path is not None self.gitlab.http_delete(path, **kwargs) |