From 2c22a34ef68da190520fac4b326144061898e0cc Mon Sep 17 00:00:00 2001 From: Eric Sabouraud Date: Mon, 11 Jun 2018 21:23:57 +0200 Subject: Add project push rules configuration (#520) --- gitlab/v4/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gitlab/v4/cli.py') 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): -- cgit v1.2.1