Skip to content

Commit

Permalink
Merge pull request #135 from nationalarchives/fix/avoid-set-publish-d…
Browse files Browse the repository at this point in the history
…efault

Explicitly make sure we set_published(True), not the implicit False
  • Loading branch information
dragon-dxw authored Dec 4, 2023
2 parents c9a5aa3 + 2d30488 commit c9dbf16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ds-caselaw-ingester/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def handler(event, context):
force_publish = Metadata(metadata).force_publish
if force_publish is True:
print(f"auto_publishing {consignment_reference} at {uri}")
api_client.set_published(uri)
api_client.set_published(uri, True)

if api_client.get_published(uri) or force_publish:
update_published_documents(uri, s3_client)
Expand Down
2 changes: 1 addition & 1 deletion ds-caselaw-ingester/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def test_handler_messages_s3(
assert "Upload Successful" in log
assert "Ingestion complete" in log
assert "auto_publish" in log
apiclient.set_published.assert_called_with("failures/TDR-2020-FAR")
apiclient.set_published.assert_called_with("failures/TDR-2020-FAR", True)
notify_new.assert_not_called()
notify_updated.assert_not_called()
annotation.assert_called_with(
Expand Down

0 comments on commit c9dbf16

Please sign in to comment.