From 1cee00eb14362bb9498b44ff6acb192c74b8b2ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Gonz=C3=A1lez=20Alonso?= Date: Wed, 24 Apr 2024 13:36:30 +0200 Subject: [PATCH] fix: allow empty export response in export_poeditor_project (#386) --- CHANGELOG.rst | 2 ++ toolium/utils/poeditor.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fc7d2b7b..2a0c43be 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,8 @@ v3.1.5 *Release date: In development* +- Fix `export_poeditor_project` method allowing empty export response + v3.1.4 ------ diff --git a/toolium/utils/poeditor.py b/toolium/utils/poeditor.py index b34bb039..d8292b49 100644 --- a/toolium/utils/poeditor.py +++ b/toolium/utils/poeditor.py @@ -168,7 +168,7 @@ def export_poeditor_project(project_info, lang, file_type): filename = response_data['result']['url'].split('/')[-1] r = send_poeditor_request(ENDPOINT_POEDITOR_DOWNLOAD_FILE + '/' + filename, "GET", {}, 200) - poeditor_terms = r.json() + poeditor_terms = r.json() if r.content else [] logger.info('POEditor terms in "%s" project with "%s" language: %s' % (project_info['name'], lang, len(poeditor_terms))) return poeditor_terms