From 15a242c3303759b77b380c5b3ff9d1e0bf2d800c Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Sat, 18 Jun 2022 09:01:20 -0700 Subject: fix(cli): project-merge-request-approval-rule Using the CLI the command: gitlab project-merge-request-approval-rule list --mr-iid 1 --project-id foo/bar Would raise an exception. This was due to the fact that `_id_attr` and `_repr_attr` were set for keys which are not returned in the response. Add a unit test which shows the `repr` function now works. Before it did not. This is an EE feature so we can't functional test it. Closes: #2065 --- gitlab/v4/objects/merge_request_approvals.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gitlab') diff --git a/gitlab/v4/objects/merge_request_approvals.py b/gitlab/v4/objects/merge_request_approvals.py index a22bd2b..eb243c7 100644 --- a/gitlab/v4/objects/merge_request_approvals.py +++ b/gitlab/v4/objects/merge_request_approvals.py @@ -165,8 +165,7 @@ class ProjectMergeRequestApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTMan class ProjectMergeRequestApprovalRule(SaveMixin, ObjectDeleteMixin, RESTObject): - _id_attr = "approval_rule_id" - _repr_attr = "approval_rule" + _repr_attr = "name" id: int approval_rule_id: int merge_request_iid: int -- cgit v1.2.1