From 5195ef05ae2e386195a19a37aef499bc7ad719e9 Mon Sep 17 00:00:00 2001 From: Jaime Lennox Date: Sat, 15 Jun 2019 20:10:32 +0100 Subject: [PATCH] Fix unassign when author is marge According to the docs: "Set to 0 or provide an empty value to unassign all assignees."[1] So setting to `None` seems like it would work, although in practice it doesn't. I've manually tested with `0` and it works fine. [1] https://docs.gitlab.com/ee/api/merge_requests.html#update-mr --- marge/merge_request.py | 2 +- tests/test_merge_request.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/marge/merge_request.py b/marge/merge_request.py index bf1aaf9e..e0c1b25b 100644 --- a/marge/merge_request.py +++ b/marge/merge_request.py @@ -177,7 +177,7 @@ def assign_to(self, user_id): )) def unassign(self): - return self.assign_to(None) + return self.assign_to(0) def fetch_approvals(self): # 'id' needed for for GitLab 9.2.2 hack (see Approvals.refetch_info()) diff --git a/tests/test_merge_request.py b/tests/test_merge_request.py index 83314dde..786fb080 100644 --- a/tests/test_merge_request.py +++ b/tests/test_merge_request.py @@ -82,7 +82,7 @@ def test_assign(self): def test_unassign(self): self.merge_request.unassign() - self.api.call.assert_called_once_with(PUT('/projects/1234/merge_requests/54', {'assignee_id': None})) + self.api.call.assert_called_once_with(PUT('/projects/1234/merge_requests/54', {'assignee_id': 0})) def test_rebase_was_not_in_progress_no_error(self): expected = [