Skip to content

Commit adb6305

Browse files
committed
dont ask for id attr if this is *Manager originating custom action
1 parent a3a7713 commit adb6305

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gitlab/v4/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@ def _populate_sub_parser_by_class(cls, sub_parser):
217217
for x in mgr_cls._from_parent_attrs]
218218
sub_parser_action.add_argument("--sudo", required=False)
219219

220+
required, optional, needs_id = cli.custom_actions[name][action_name]
220221
# We need to get the object somehow
221-
if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(cls):
222+
if needs_id and gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(cls):
222223
if cls._id_attr is not None:
223224
id_attr = cls._id_attr.replace('_', '-')
224225
sub_parser_action.add_argument("--%s" % id_attr,
225226
required=True)
226227

227-
required, optional, dummy = cli.custom_actions[name][action_name]
228228
[sub_parser_action.add_argument("--%s" % x.replace('_', '-'),
229229
required=True)
230230
for x in required if x != cls._id_attr]

0 commit comments

Comments
 (0)