Should default return type for is_loaned_out_on_ia should be False not None? #9118
Labels
Lead: @mekarpeles
Issues overseen by Mek (Staff: Program Lead) [managed]
Module: Borrowing / Lending
Needs: Review
This issue/PR needs to be reviewed in order to be closed or merged (see comments). [managed]
Priority: 3
Issues that we can consider at our leisure. [managed]
Type: Bug
Something isn't working. [managed]
Type: Question
This issue doesn't require code. A question needs an answer. [managed]
Problem
Evidence / Screenshot
openlibrary/openlibrary/core/lending.py
Lines 564 to 572 in ce273d8
This code returns
None
.I'm fairly certain we should not return
None
. Based on how it is used, it is evaluating toFalse
. As in "false, the book isn't loaned out because there was an error". In my opinion, we should probably default to returningTrue
instead.I've gotten a bit stumped a few times trying to follow the code. However, at least the code path ending here with waitinglists seems like it would get an error from this logic.
openlibrary/openlibrary/templates/admin/waitinglists.html
Lines 34 to 39 in 1f614a1
Relevant URL(s)
Reproducing the bug
No response
Context
Found during #9117
Notes from this Issue's Lead
Proposal & constraints
Related files
Stakeholders
The text was updated successfully, but these errors were encountered: