Skip to content

Commit

Permalink
Merge pull request #330 from RockefellerArchiveCenter/development
Browse files Browse the repository at this point in the history
Only group reading room requests
  • Loading branch information
helrond authored Feb 28, 2024
2 parents ad0bf72 + 0e35470 commit d1f9ae2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
32 changes: 16 additions & 16 deletions process_request/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,22 +214,6 @@ def __init__(self):
self.request_defaults = {
"AeonForm": "EADRequest",
"DocumentType": "Default",
"GroupingIdentifier": "GroupingField",
"GroupingOption_EADNumber": "FirstValue",
"GroupingOption_ItemInfo1": "Concatenate",
"GroupingOption_ItemDate": "Concatenate",
"GroupingOption_ItemTitle": "FirstValue",
"GroupingOption_ItemAuthor": "FirstValue",
"GroupingOption_ItemSubtitle": "FirstValue",
"GroupingOption_ItemVolume": "FirstValue",
"GroupingOption_ItemIssue": "Concatenate",
"GroupingOption_ItemInfo2": "Concatenate",
"GroupingOption_CallNumber": "FirstValue",
"GroupingOption_ItemInfo3": "FirstValue",
"GroupingOption_ItemCitation": "FirstValue",
"GroupingOption_ItemNumber": "FirstValue",
"GroupingOption_Location": "FirstValue",
"GroupingOption_ItemInfo5": "FirstValue",
"UserReview": "No",
"SubmitButton": "Submit Request",
}
Expand Down Expand Up @@ -274,6 +258,22 @@ def prepare_reading_room_request(self, items, request_data):
data: Submission data for Aeon.
"""
reading_room_defaults = {
"GroupingIdentifier": "GroupingField",
"GroupingOption_EADNumber": "FirstValue",
"GroupingOption_ItemInfo1": "Concatenate",
"GroupingOption_ItemDate": "Concatenate",
"GroupingOption_ItemTitle": "FirstValue",
"GroupingOption_ItemAuthor": "FirstValue",
"GroupingOption_ItemSubtitle": "FirstValue",
"GroupingOption_ItemVolume": "FirstValue",
"GroupingOption_ItemIssue": "Concatenate",
"GroupingOption_ItemInfo2": "Concatenate",
"GroupingOption_CallNumber": "FirstValue",
"GroupingOption_ItemInfo3": "FirstValue",
"GroupingOption_ItemCitation": "FirstValue",
"GroupingOption_ItemNumber": "FirstValue",
"GroupingOption_Location": "FirstValue",
"GroupingOption_ItemInfo5": "FirstValue",
"WebRequestForm": "DefaultRequest",
"RequestType": "Loan",
"ScheduledDate": request_data.get("scheduledDate"),
Expand Down
2 changes: 2 additions & 0 deletions process_request/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,12 @@ def test_send_aeon_requests(self, mock_get_data):
data = {"scheduled_date": date.today().isoformat(), "items": random_list()}
delivered = AeonRequester().get_request_data("readingroom", "https://dimes.rockarch.org", **data)
self.assertTrue(isinstance(delivered, dict))
self.assertIn("GroupingIdentifier", delivered)

data["format"] = "jpeg"
delivered = AeonRequester().get_request_data("duplication", "https://dimes.rockarch.org", **data)
self.assertTrue(isinstance(delivered, dict))
self.assertNotIn("GroupingIdentifier", delivered)

request_type = "foo"
with self.assertRaises(ValueError, msg="Unknown request type '{}', expected either 'readingroom' or 'duplication'".format(request_type)):
Expand Down

0 comments on commit d1f9ae2

Please sign in to comment.