summaryrefslogtreecommitdiff
path: root/gitlab/v4/cli.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/v4/cli.py
parent617aa64c8066ace4be4bbc3f510f27d3a0519daf (diff)
downloadgitlab-2c22a34ef68da190520fac4b326144061898e0cc.tar.gz
Add project push rules configuration (#520)
Diffstat (limited to 'gitlab/v4/cli.py')
-rw-r--r--gitlab/v4/cli.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py
index 0e50de1..451bec8 100644
--- a/gitlab/v4/cli.py
+++ b/gitlab/v4/cli.py
@@ -143,8 +143,9 @@ def _populate_sub_parser_by_class(cls, sub_parser):
action='store_true')
if action_name == 'delete':
- id_attr = cls._id_attr.replace('_', '-')
- sub_parser_action.add_argument("--%s" % id_attr, required=True)
+ if cls._id_attr is not None:
+ id_attr = cls._id_attr.replace('_', '-')
+ sub_parser_action.add_argument("--%s" % id_attr, required=True)
if action_name == "get":
if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(cls):