Skip to content

Commit 62c75b5

Browse files
authored
Merge pull request #1411 from JohnVillalovos/jlvillal/list_filters
chore: make ListMixin._list_filters always present
2 parents 09522b3 + 8933113 commit 62c75b5

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

gitlab/mixins.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
Dict,
2323
List,
2424
Optional,
25+
Tuple,
2526
Type,
2627
TYPE_CHECKING,
2728
Union,
@@ -186,6 +187,7 @@ def refresh(self, **kwargs: Any) -> None:
186187
class ListMixin(_RestManagerBase):
187188
_computed_path: Optional[str]
188189
_from_parent_attrs: Dict[str, Any]
190+
_list_filters: Tuple[str, ...] = ()
189191
_obj_cls: Optional[Type[base.RESTObject]]
190192
_parent: Optional[base.RESTObject]
191193
_parent_attrs: Dict[str, Any]

gitlab/v4/cli.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,10 @@ def _populate_sub_parser_by_class(cls, sub_parser):
145145
)
146146

147147
if action_name == "list":
148-
if hasattr(mgr_cls, "_list_filters"):
149-
[
150-
sub_parser_action.add_argument(
151-
"--%s" % x.replace("_", "-"), required=False
152-
)
153-
for x in mgr_cls._list_filters
154-
]
148+
for x in mgr_cls._list_filters:
149+
sub_parser_action.add_argument(
150+
"--%s" % x.replace("_", "-"), required=False
151+
)
155152

156153
sub_parser_action.add_argument("--page", required=False)
157154
sub_parser_action.add_argument("--per-page", required=False)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy