Skip to content

Commit

Permalink
Fixed but in update_media task where standalone_media_url was false.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed May 27, 2024
1 parent cdf5211 commit 066f567
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions workbench
Original file line number Diff line number Diff line change
Expand Up @@ -1343,18 +1343,9 @@ def update_media() -> None:

if file_to_delete:
# Now we delete the file
if config["standalone_media_url"] is True:
file_endpoint = (
config["host"] + "/entity/file/" + file_to_delete + "?_format=json"
)
else:
file_endpoint = (
config["host"]
+ "/entity/file/"
+ file_to_delete
+ "/edit?_format=json"
)

file_endpoint = (
config["host"] + "/entity/file/" + file_to_delete + "?_format=json"
)
file_response = issue_request(config, "DELETE", file_endpoint)
if file_response.status_code == 204:
logging.info(
Expand All @@ -1363,9 +1354,9 @@ def update_media() -> None:
return True
else:
logging.error(
"File %s (from media %s) not deleted (HTTP response code %s). Assuming there was no file and attempting to add new file.",
"File %s (from media %s) not deleted (HTTP response code %s).",
file_to_delete,
media_id,
file_endpoint,
file_response.status_code,
)
return False
Expand Down

0 comments on commit 066f567

Please sign in to comment.