Skip to content

Commit

Permalink
Merge pull request #285 from RockefellerArchiveCenter/development
Browse files Browse the repository at this point in the history
Tighten check for digital objects
  • Loading branch information
helrond authored Jun 6, 2023
2 parents af54e10 + dc7671a commit c0c24fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion process_request/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def is_submittable(self, item):
elif item["restrictions"] == "closed":
submit = False
reason = "This item is currently unavailable for request. It will not be included in request. Reason: {}".format(item.get("restrictions_text"))
elif "digital" in item["preferred_instance"]["format"].lower():
elif item["preferred_instance"]["format"].lower() == "digital_object":
submit = False
reason = "This item is already available online. It will not be included in request."
elif item["restrictions"] == "conditional":
Expand Down
2 changes: 1 addition & 1 deletion process_request/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def test_parse_item(self, mock_get_data):

# Ensure objects with attached digital objects return correct message
for format, submit in [
("Digital", False), ("Mixed materials", True), ("microfilm", True)]:
("Digital", True), ("digital_object", False), ("Mixed materials", True), ("microfilm", True)]:
mock_get_data.return_value[0]["preferred_instance"]["format"] = format
parsed = Processor().parse_item(item["uri"], "https://dimes.rockarch.org")
self.assertEqual(parsed["submit"], submit)
Expand Down

0 comments on commit c0c24fb

Please sign in to comment.