@@ -2996,7 +2996,12 @@ class ProjectMergeRequestApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTMan
29962996
29972997 @exc .on_http_error (exc .GitlabUpdateError )
29982998 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
30003005 ):
30013006 """Change MR-level allowed approvers and approver groups.
30023007
@@ -3050,27 +3055,33 @@ def save(self, **kwargs):
30503055 GitlabAuthenticationError: If authentication is not correct
30513056 GitlabUpdateError: If the server cannot perform the request
30523057 """
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.
30553060 self .approval_rule_id = self .id
30563061 self .merge_request_iid = self ._parent_attrs ["mr_iid" ]
30573062 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."""
30603065 SaveMixin .save (self , ** kwargs )
30613066
30623067
3063- class ProjectMergeRequestApprovalRuleManger (ListMixin , UpdateMixin , CreateMixin , RESTManager ):
3068+ class ProjectMergeRequestApprovalRuleManger (
3069+ ListMixin , UpdateMixin , CreateMixin , RESTManager
3070+ ):
30643071 _path = "/projects/%(project_id)s/merge_requests/%(mr_iid)s/approval_rules"
30653072 _obj_cls = ProjectMergeRequestApprovalRule
30663073 _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+ )
30743085
30753086 def create (self , data , ** kwargs ):
30763087 """Create a new object.
0 commit comments