Skip to content

Commit 858cbc0

Browse files
jnbolitogonchik
andauthored
[Bitbucket] Fixed broken update_file and upload_file API calls (fixes issue #1080) (#1092)
* [Bitbucket] Fixed broken update_file and upload_file API calls * Black formatting Co-authored-by: Gonchik Tsymzhitov <gonchik.tsymzhitov@gmail.com>
1 parent 211f26b commit 858cbc0

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

atlassian/bitbucket/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,7 +2649,7 @@ def upload_file(self, project_key, repository_slug, content, message, branch, fi
26492649
"""
26502650
url = self._url_file(project_key, repository_slug, filename)
26512651
data = {"content": content, "message": message, "branch": branch}
2652-
return self.put(url, files=data)
2652+
return self.put(url, files=data, headers={"Accept": "application/json"})
26532653

26542654
def update_file(
26552655
self,
@@ -2679,7 +2679,7 @@ def update_file(
26792679
"branch": branch,
26802680
"sourceCommitId": source_commit_id,
26812681
}
2682-
return self.put(url, files=data)
2682+
return self.put(url, files=data, headers={"Accept": "application/json"})
26832683

26842684
def search_code(self, team, search_query, page=1, limit=10):
26852685
"""

atlassian/service_desk.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,7 @@ def attach_temporary_file(self, service_desk_id, filename):
524524

525525
with open(filename, "rb") as file:
526526
result = (
527-
self.post(
528-
path=url,
529-
headers=experimental_headers,
530-
files={"file": file},
531-
)
527+
self.post(path=url, headers=experimental_headers, files={"file": file})
532528
.json()
533529
.get("temporaryAttachments")
534530
)

0 commit comments

Comments
 (0)