From 08a78d0bf2341fddd24684466c36c0c9b56f5b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 4 Oct 2023 21:31:13 -0400 Subject: [PATCH] Send patch as JSON which is needed for state to work --- move_issue.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/move_issue.py b/move_issue.py index 4b6dd60..b635106 100644 --- a/move_issue.py +++ b/move_issue.py @@ -96,12 +96,11 @@ def move_issue(source_owner, source_repo, issue_number, destination_owner, desti # Note though we often change the owner and repo and index when making the URL! # This runs and the state string is correct and it *should* work but it does not. # See https://codeberg.org/forgejo/forgejo/issues/1280#issuecomment-1262414 - patch = { - # 'title': "MOVED", - 'state': "closed" + body = { + "state": "closed" } patch_issue_url = API_PATCH_ISSUE.format(instance=FORGEJO_INSTANCE, owner=source_owner, repo=source_repo, index=issue_number) - closed_response = requests.patch(patch_issue_url, headers=headers, data=patch) + closed_response = requests.patch(patch_issue_url, headers=headers, json=body, params={"access_token": FORGEJO_API_TOKEN}) # print(closed_response.json()) if __name__=="__main__":