Skip to content

Commit

Permalink
#7: Localize submission blocks and reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
ctgraham committed Sep 2, 2022
1 parent b42f943 commit ad6eac1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions process_request/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,15 @@ def is_submittable(self, item):
submit = True
reason = None
if not any(value for value in item["preferred_instance"].values()):
submit = False
reason = "This item is currently unavailable for request. It will not be included in request. Reason: Required information about the physical container of this item is not available."
reason = "This item may not be available for request, but attempt will be made to include it. Reason: Required information about the physical container of this item is not available."
elif item.get("restrictions_text") and item.get("restrictions_text").strip() == "No restrictions.":
reason = None
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"))
reason = "This item may be restricted; A&SC staff will follow up with you if needed. Reason: {}".format(item.get("restrictions_text"))
elif "digital" in item["preferred_instance"]["format"].lower():
submit = False
reason = "This item is already available online. It will not be included in request."
reason = "This item is already available online, but it will be included in request."
elif item["restrictions"] == "conditional":
reason = "This item may be currently unavailable for request. It will be included in request. Reason: {}".format(item.get("restrictions_text"))
reason = "This item may be restricted; A&SC staff will follow up with you if needed. Reason: {}".format(item.get("restrictions_text"))
return submit, reason

def parse_item(self, uri, baseurl):
Expand Down

0 comments on commit ad6eac1

Please sign in to comment.