@@ -2996,7 +2996,12 @@ class ProjectMergeRequestApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTMan
2996
2996
2997
2997
@exc .on_http_error (exc .GitlabUpdateError )
2998
2998
def set_approvers (
2999
- self , approvals_required , approver_ids = None , approver_group_ids = None , approval_rule_name = "name" , ** kwargs
2999
+ self ,
3000
+ approvals_required ,
3001
+ approver_ids = None ,
3002
+ approver_group_ids = None ,
3003
+ approval_rule_name = "name" ,
3004
+ ** kwargs
3000
3005
):
3001
3006
"""Change MR-level allowed approvers and approver groups.
3002
3007
@@ -3050,27 +3055,33 @@ def save(self, **kwargs):
3050
3055
GitlabAuthenticationError: If authentication is not correct
3051
3056
GitlabUpdateError: If the server cannot perform the request
3052
3057
"""
3053
- #There is a mismatch between the name of our id attribute and the put REST API name for the
3054
- #project_id, so we override it here.
3058
+ # There is a mismatch between the name of our id attribute and the put REST API name for the
3059
+ # project_id, so we override it here.
3055
3060
self .approval_rule_id = self .id
3056
3061
self .merge_request_iid = self ._parent_attrs ["mr_iid" ]
3057
3062
self .id = self ._parent_attrs ["project_id" ]
3058
- #save will update self.id with the result from the server, so no need to overwrite with
3059
- #what it was before we overwrote it."""
3063
+ # save will update self.id with the result from the server, so no need to overwrite with
3064
+ # what it was before we overwrote it."""
3060
3065
SaveMixin .save (self , ** kwargs )
3061
3066
3062
3067
3063
- class ProjectMergeRequestApprovalRuleManger (ListMixin , UpdateMixin , CreateMixin , RESTManager ):
3068
+ class ProjectMergeRequestApprovalRuleManger (
3069
+ ListMixin , UpdateMixin , CreateMixin , RESTManager
3070
+ ):
3064
3071
_path = "/projects/%(project_id)s/merge_requests/%(mr_iid)s/approval_rules"
3065
3072
_obj_cls = ProjectMergeRequestApprovalRule
3066
3073
_from_parent_attrs = {"project_id" : "project_id" , "mr_iid" : "iid" }
3067
- _list_filters = ("name" ,"rule_type" )
3068
- _update_attrs = (("id" ,"merge_request_iid" ,"approval_rule_id" ,"name" ,"approvals_required" ),
3069
- ("user_ids" ,"group_ids" ))
3070
- #Important: When approval_project_rule_id is set, the name, users and groups of
3071
- #project-level rule will be copied. The approvals_required specified will be used. """
3072
- _create_attrs = (("id" ,"merge_request_iid" ,"name" ,"approvals_required" ),
3073
- ("approval_project_rule_id" , "user_ids" ,"group_ids" ))
3074
+ _list_filters = ("name" , "rule_type" )
3075
+ _update_attrs = (
3076
+ ("id" , "merge_request_iid" , "approval_rule_id" , "name" , "approvals_required" ),
3077
+ ("user_ids" , "group_ids" ),
3078
+ )
3079
+ # Important: When approval_project_rule_id is set, the name, users and groups of
3080
+ # project-level rule will be copied. The approvals_required specified will be used. """
3081
+ _create_attrs = (
3082
+ ("id" , "merge_request_iid" , "name" , "approvals_required" ),
3083
+ ("approval_project_rule_id" , "user_ids" , "group_ids" ),
3084
+ )
3074
3085
3075
3086
def create (self , data , ** kwargs ):
3076
3087
"""Create a new object.
0 commit comments