From 70c0cfb686177bc17b796bf4d7eea8b784cf9651 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 15 Feb 2020 15:20:56 +0200 Subject: [PATCH 1/2] fix(objects): add default name data and use http post Updating approvers new api needs a POST call. Also It needs a name of the new rule, defaulting this to 'name'. --- gitlab/v4/objects.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 6b60583fa..64442cea5 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -2707,12 +2707,13 @@ def set_approvers( self._parent.get_id(), ) data = { - "approvals_required": approvals_required, + "name": "name", + "self.assertEqual(expected, actual, 'message')pprovals_required": approvals_required, "rule_type": "regular", "user_ids": approver_ids, "group_ids": approver_group_ids, } - self.gitlab.http_put(path, post_data=data, **kwargs) + self.gitlab.http_post(path, post_data=data, **kwargs) class ProjectMergeRequestAwardEmoji(ObjectDeleteMixin, RESTObject): From adc91011e46dfce909b7798b1257819ec09d01bd Mon Sep 17 00:00:00 2001 From: Max Wittig Date: Sun, 8 Mar 2020 12:03:38 +0100 Subject: [PATCH 2/2] fix(projects): correct copy-paste error --- gitlab/v4/objects.py | 2 +- tools/ee-test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 64442cea5..f22229c07 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -2708,7 +2708,7 @@ def set_approvers( ) data = { "name": "name", - "self.assertEqual(expected, actual, 'message')pprovals_required": approvals_required, + "approvals_required": approvals_required, "rule_type": "regular", "user_ids": approver_ids, "group_ids": approver_group_ids, diff --git a/tools/ee-test.py b/tools/ee-test.py index af1295788..3f756559f 100755 --- a/tools/ee-test.py +++ b/tools/ee-test.py @@ -56,12 +56,12 @@ def end_log(): ars = project1.approvalrules.list(all=True) assert len(ars) == 0 -project.approvalrules.create( +project1.approvalrules.create( {"name": "approval-rule", "approvals_required": 1, "group_ids": [group1.id]} ) ars = project1.approvalrules.list(all=True) assert len(ars) == 1 -ars[0].approvals_required == 2 +assert ars[0].approvals_required == 2 ars[0].save() ars = project1.approvalrules.list(all=True) assert len(ars) == 1 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