Skip to content

Commit f79dc99

Browse files
committed
Fixing exceptions where no JSON is returned.
1 parent 2749fac commit f79dc99

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

installer/deploy.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@
9393
version_info.update(parse_version_info(os.path.join(artifact_dir, "install-x64", "share", repo_name)))
9494
output(str(version_info))
9595

96+
# Get version info
97+
openshot_qt_version = version_info.get('openshot-qt', {}).get('VERSION', 'N/A')
98+
9699
# Verify branch names are all the same (across the 3 repos)
97100
original_git_branch = ''
98101
for repo_name in repo_names:
@@ -263,23 +266,18 @@
263266

264267
# Submit blog post (if it doesn't already exist) (in draft mode)
265268
auth = HTTPBasicAuth(os.getenv('OPENSHOT_ORG_USER'), os.getenv('OPENSHOT_ORG_PASS'))
266-
r = post("https://www.openshot.org/api/release/submit/", auth=auth, data={ "version": github_release.tag_name,
269+
r = post("https://www.openshot.org/api/release/submit/", auth=auth, data={ "version": openshot_qt_version,
267270
"changelog": log_title + combined_log_markdown })
268271
if not r.ok:
269272
raise Exception("HTTP post to openshot.org/api/release/submit/ failed: %s (user: %s): %s" %
270-
(r.status_code, os.getenv('OPENSHOT_ORG_USER'),
271-
r.json().get('message', 'no error message found')))
273+
(r.status_code, os.getenv('OPENSHOT_ORG_USER'), r.content.decode('UTF-8')))
272274
else:
273-
# Get release object
274-
openshot_qt_version = version_info.get('openshot-qt', {}).get('VERSION', 'N/A')
275-
276275
# Publish the release (make new version visible on openshot.org, and make blog post visible)
277276
auth = HTTPBasicAuth(os.getenv('OPENSHOT_ORG_USER'), os.getenv('OPENSHOT_ORG_PASS'))
278277
r = post("https://www.openshot.org/api/release/publish/", auth=auth, data={"version": openshot_qt_version })
279278
if not r.ok:
280279
raise Exception("HTTP post to openshot.org/api/release/publish/ failed: %s (user: %s): %s" %
281-
(r.status_code, os.getenv('OPENSHOT_ORG_USER'),
282-
r.json().get('message', 'no error message found')))
280+
(r.status_code, os.getenv('OPENSHOT_ORG_USER'), r.content.decode('UTF-8')))
283281

284282
# Publish GitHub Release objects (in all 3 repos)
285283
for repo_name in repo_names:

0 commit comments

Comments
 (0)