8000 Fix unit tests (delete without id) · python-gitlab/python-gitlab@8b06fa2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b06fa2

Browse files
committed
Fix unit tests (delete without id)
1 parent 0304ed3 commit 8b06fa2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gitlab/v4/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ def _populate_sub_parser_by_class(cls, sub_parser):
143143
action='store_true')
144144

145145
if action_name == 'delete':
146-
id_attr = cls._id_attr.replace('_', '-')
147-
sub_parser_action.add_argument("--%s" % id_attr, required=True)
146+
if cls._id_attr is not None:
147+
id_attr = cls._id_attr.replace('_', '-')
148+
sub_parser_action.add_argument("--%s" % id_attr, required=True)
148149

149150
if action_name == "get":
150151
if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(cls):

0 commit comments

Comments
 (0)
0