Conversation
RayBB
commented
Aug 14, 2025
Comment on lines
-174
to
-176
| result = OpenLibraryAccount.get( | ||
| email=i.email, link=i.itemname, username=i.username | ||
| ) |
Collaborator
Author
There was a problem hiding this comment.
Note: this was probably never working as intended as it would just always check one and not the rest.
7bf1922 to
c2c48eb
Compare
cdrini
approved these changes
Sep 3, 2025
Collaborator
cdrini
left a comment
There was a problem hiding this comment.
Lgtm! One change to make sure the behaviour is the same as it was before and to avoid some unnecessary db calls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a followup to the note we put here:
https://github.com/internetarchive/openlibrary/pull/10999/files#diff-884f3a712a7e51cce625ca19060335684272f33a967702b19e66e48dbdd1be69R495
Turns out raising by default isn't probably the ideal behavior for our codebase because we call the method fairly often and expect a None to get back.
As such, I added
Changes:
.getmethod with.get_by_*methods which are better defined..getmethod, we can use.get_or_raisewhen we want to raise..get_or_raiseto accept just a value and a literal for the type of valuetest=from the get methodsPS: This refactor my seem a little silly but as I'm digging into the #11133 it's been a challenge to get a user so cleaning up this code can make that a little easier.
Technical
Testing
Screenshot
Stakeholders