Skip to content
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

Merged
merged 2 commits into from
Sep 1, 2022
Merged

Conversation

ctgraham
Copy link
Contributor

@ctgraham ctgraham commented Sep 1, 2022

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.

Comment on lines 253 to 257
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")

Copy link
Member

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.

Copy link
Member

@helrond helrond left a 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...

@ctgraham
Copy link
Contributor Author

ctgraham commented Sep 1, 2022

Yes, I see now that the top-level Location field is a spurious localization on our part.

@helrond
Copy link
Member

helrond commented Sep 1, 2022

@ctgraham I think this looks good, but do you want to proceed before putting the Reading Room ID somewhere else? Or is this something we should try to resolve in #228?

@ctgraham
Copy link
Contributor Author

ctgraham commented Sep 1, 2022

The readingRoomId is dangling in our DIMES instance. It is an unused local and we need to remove it.

Copy link
Member

@helrond helrond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@helrond helrond merged commit 97d565c into development Sep 1, 2022
@helrond helrond deleted the issue-227 branch September 1, 2022 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants