Repository navigation
Tags: internetarchive/openlibrary
Tags
Pass the s3 cookie into get_loan_history_data (#14001) * Pass the s3 cookie into get_loan_history_data /account/loan-history.json 500'd under FastAPI because get_loan_history_data read web.cookies(), which needs a web.py request. Callers now pass the cookie in, as fastapi/borrow.py already does, and a missing account raises AccountNotFoundError (404 at each route) instead of web.py's render.notfound. Closes #13959 * Trim loan history docstring and redundant tests The route test in test_account_loans.py already covers the cookie being passed through without web.cookies(), so drop the heavily mocked duplicate in test_lending.py and a repeated assertion. --------- Co-authored-by: Raymond Berger <[email protected]>
Pass the s3 cookie into get_loan_history_data (#14001) * Pass the s3 cookie into get_loan_history_data /account/loan-history.json 500'd under FastAPI because get_loan_history_data read web.cookies(), which needs a web.py request. Callers now pass the cookie in, as fastapi/borrow.py already does, and a missing account raises AccountNotFoundError (404 at each route) instead of web.py's render.notfound. Closes #13959 * Trim loan history docstring and redundant tests The route test in test_account_loans.py already covers the cookie being passed through without web.cookies(), so drop the heavily mocked duplicate in test_lending.py and a repeated assertion. --------- Co-authored-by: Raymond Berger <[email protected]>
Pass the s3 cookie into get_loan_history_data (#14001) * Pass the s3 cookie into get_loan_history_data /account/loan-history.json 500'd under FastAPI because get_loan_history_data read web.cookies(), which needs a web.py request. Callers now pass the cookie in, as fastapi/borrow.py already does, and a missing account raises AccountNotFoundError (404 at each route) instead of web.py's render.notfound. Closes #13959 * Trim loan history docstring and redundant tests The route test in test_account_loans.py already covers the cookie being passed through without web.cookies(), so drop the heavily mocked duplicate in test_lending.py and a repeated assertion. --------- Co-authored-by: Raymond Berger <[email protected]>
Migrate Bestbook FastAPI queries to async DB (#14112) * Migrate Bestbook FastAPI queries to async DB * Return 422 for malformed work_id on /awards/count.json work_id values like "abc", "OLxyzW" or "" raised ValueError/IndexError while parsing and returned 500 (master too). Validate the parameter as a numeric work ID or work OLID so bad input gets a 422. * Drop bestbook unit tests the integration test already covers The removed tests asserted exact SQL strings or substrings, or exercised get_awards_sync through a fake async_bridge; the Postgres integration test runs the same queries for real (and now also checks get_count with an OLID). Keep the concurrent-conflict recheck test, which the integration test can't reach, and test_remove_requires_a_filter. * Remove Bestbook.get_awards_sync and the unused Work award helpers Work.get_awards, Work.check_if_user_awarded and Work.get_award_by_username have no callers anywhere (Python, templates, macros, JS), and they were the only users of the new get_awards_sync bridge. Drop all four. * Rename test_bestbook_async.py to test_bestbook.py One test file per module: the Bestbook model's unit and Postgres integration tests live in tests/core/test_bestbook.py, not a separate _async file. --------- Co-authored-by: Raymond Berger <[email protected]>
Start the olbase build from the deploy wizard with gh (#13947) If the olbase image is out of date and the gh CLI is installed, the wizard now triggers olbase.yaml itself before the announcement and waits for it with `gh run watch` before the openlibrary deploy. Without gh it falls back to the existing "click Run workflow" prompt.
Pre-fill fields when switching to advanced search (#13601) Co-Authored-By: Utkarsh Arya <[email protected]> Co-authored-by: Claude Sonnet 5 <[email protected]> Co-authored-by: Drini Cami <[email protected]>
PreviousNext