-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#227: Pass along reading room and site if provided #232
Conversation
process_request/routines.py
Outdated
if request_data.get("readingRoomID"): | ||
reading_room_defaults["Location"] = request_data.get("readingRoomID") | ||
if request_data.get("site"): | ||
reading_room_defaults["Site"] = request_data.get("site") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be cleaner to just add these values directly to the defaults and then filter out null values in get_request_data
by returning something like {k: v for k, v in data.items() if v}
in line 293.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would advocate for implementing something that strips out all null values at a single point, because as we get into this configuration stuff there are likely to be other places where we'll be inserting empty values and will want to remove them before submitting.
HOWEVER, the larger problem here is related to mapping - there is already a Locations
field in use for data about the location of the requested item...
Yes, I see now that the top-level |
The readingRoomId is dangling in our DIMES instance. It is an unused local and we need to remove it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Resolves #227. Assumes that python conditionals work with falsey values and the
request_data.get()
method will return a falsey value for a non-existent key.