| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8fc8e35 commit 6e204ce
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2490,7 +2490,7 @@ class ProjectMergeRequestApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTMan | |||
| 2490 | 2490 | _update_uses_post = True | |
| 2491 | 2491 | ||
| 2492 | 2492 | @exc.on_http_error(exc.GitlabUpdateError) | |
| 2493 | - def set_approvers(self, approver_ids=[], approver_group_ids=[], **kwargs): | ||
| 2493 | + def set_approvers(self, approver_ids=None, approver_group_ids=None, **kwargs): | ||
| 2494 | 2494 | """Change MR-level allowed approvers and approver groups. | |
| 2495 | 2495 | ||
| 2496 | 2496 | Args: | |
@@ -2501,6 +2501,9 @@ def set_approvers(self, approver_ids=[], approver_group_ids=[], **kwargs): | |||
| 2501 | 2501 | GitlabAuthenticationError: If authentication is not correct | |
| 2502 | 2502 | GitlabUpdateError: If the server failed to perform the request | |
| 2503 | 2503 | """ | |
| 2504 | + approver_ids = approver_ids or [] | ||
| 2505 | + approver_group_ids = approver_group_ids or [] | ||
| 2506 | + | ||
| 2504 | 2507 | path = "%s/%s/approvers" % (self._parent.manager.path, self._parent.get_id()) | |
| 2505 | 2508 | data = {"approver_ids": approver_ids, "approver_group_ids": approver_group_ids} | |
| 2506 | 2509 | self.gitlab.http_put(path, post_data=data, **kwargs) | |
@@ -3692,7 +3695,7 @@ class ProjectApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTManager): | |||
| 3692 | 3695 | _update_uses_post = True | |
| 3693 | 3696 | ||
| 3694 | 3697 | @exc.on_http_error(exc.GitlabUpdateError) | |
| 3695 | - def set_approvers(self, approver_ids=[], approver_group_ids=[], **kwargs): | ||
| 3698 | + def set_approvers(self, approver_ids=None, approver_group_ids=None, **kwargs): | ||
| 3696 | 3699 | """Change project-level allowed approvers and approver groups. | |
| 3697 | 3700 | ||
| 3698 | 3701 | Args: | |
@@ -3703,6 +3706,8 @@ def set_approvers(self, approver_ids=[], approver_group_ids=[], **kwargs): | |||
| 3703 | 3706 | GitlabAuthenticationError: If authentication is not correct | |
| 3704 | 3707 | GitlabUpdateError: If the server failed to perform the request | |
| 3705 | 3708 | """ | |
| 3709 | + approver_ids = approver_ids or [] | ||
| 3710 | + approver_group_ids = approver_group_ids or [] | ||
| 3706 | 3711 | ||
| 3707 | 3712 | path = "/projects/%s/approvers" % self._parent.get_id() | |
| 3708 | 3713 | data = {"approver_ids": approver_ids, "approver_group_ids": approver_group_ids} | |
| Back | FazBrowse Home | New Git URL |
0 commit comments