Skip to content

Commit

Permalink
Some tweaks to output and logging when creating and updating terms.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Nov 4, 2024
1 parent 584ca09 commit 65b372d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions workbench
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion workbench_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 65b372d

Please sign in to comment.