diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-04-26 23:53:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-26 23:53:26 +0200 |
commit | 5b81d7d25e5deefa4333098ebb5bc646fcee2c8d (patch) | |
tree | 689b1e9a53dbc006fe3d4db929633facd4d44ba3 /gitlab/v4/cli.py | |
parent | 37af2296703a481721489a66c5fc554257e34527 (diff) | |
parent | 3c1a0b3ba1f529fab38829c9d355561fd36f4f5d (diff) | |
download | gitlab-5b81d7d25e5deefa4333098ebb5bc646fcee2c8d.tar.gz |
Merge pull request #1412 from JohnVillalovos/jlvillal/optional_get_attrs
chore: make Get.*Mixin._optional_get_attrs always present
Diffstat (limited to 'gitlab/v4/cli.py')
-rw-r--r-- | gitlab/v4/cli.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py index 76eb1cb..42b94aa 100644 --- a/gitlab/v4/cli.py +++ b/gitlab/v4/cli.py @@ -165,13 +165,10 @@ def _populate_sub_parser_by_class(cls, sub_parser): id_attr = cls._id_attr.replace("_", "-") sub_parser_action.add_argument("--%s" % id_attr, required=True) - if hasattr(mgr_cls, "_optional_get_attrs"): - [ - sub_parser_action.add_argument( - "--%s" % x.replace("_", "-"), required=False - ) - for x in mgr_cls._optional_get_attrs - ] + for x in mgr_cls._optional_get_attrs: + sub_parser_action.add_argument( + "--%s" % x.replace("_", "-"), required=False + ) if action_name == "create": for x in mgr_cls._create_attrs.required: |