From 65b372da2236fdfb3c4c2acfc4a56e79318312f9 Mon Sep 17 00:00:00 2001 From: Mark Jordan Date: Mon, 4 Nov 2024 07:03:04 -0800 Subject: [PATCH] Some tweaks to output and logging when creating and updating terms. --- workbench | 8 ++++++++ workbench_utils.py | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/workbench b/workbench index 40cdf39..92ae975 100755 --- a/workbench +++ b/workbench @@ -3326,6 +3326,14 @@ def update_terms(): "Term %s updated.", config["host"] + "/taxonomy/term/" + row["term_id"], ) + else: + message = ( + f'Term {config["host"]}/taxonomy/term/{row["term_id"]} not updated.' + ) + print("Warning: " + message) + logging.warning( + f"{message} HTTP response code was {term_response.status_code}. Response body was {term_response.text}." + ) if config["progress_bar"] is True: row_count += 1 diff --git a/workbench_utils.py b/workbench_utils.py index e15b339..28467ca 100644 --- a/workbench_utils.py +++ b/workbench_utils.py @@ -6480,9 +6480,10 @@ def create_term(config, vocab_id, term_name, term_csv_row=None): return tid else: logging.warning( - "Term '%s' not created, HTTP response code was %s.", + "Term '%s' not created, HTTP response code was %s, response body was %s.", term_name, response.status_code, + response.text, ) return False