From 6f3cb17beb47f46826de4ad96cf1bba5fb44af6d Mon Sep 17 00:00:00 2001 From: Terrtia Date: Tue, 28 Apr 2020 15:02:22 +0200 Subject: [PATCH] chg: [API json import] take list as imput --- bin/import/importer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/import/importer.py b/bin/import/importer.py index 585f4065..327131ee 100755 --- a/bin/import/importer.py +++ b/bin/import/importer.py @@ -104,6 +104,8 @@ def api_import_json_item(data_json): return ({'status': 'error', 'reason': 'Malformed JSON'}, 400) # # TODO: add JSON verification - res = add_json_to_json_queue(data_json) - if not res: - return ({'status': 'success'}, 200) + for item_json in data_json: + res = add_json_to_json_queue(item_json) + if res: + return ({'status': 'error'}, 400) + return ({'status': 'success'}, 200)