Skip to content

Commit

Permalink
Merge pull request #48 from NatLibFi/bugfix/borrowing
Browse files Browse the repository at this point in the history
Fix borrowing for patrons in a consortium
  • Loading branch information
attemoi authored Apr 18, 2024
2 parents a0b4f8b + 5762c21 commit 8746904
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions api/controller/circulation_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytz
from flask import Response
from flask_babel import lazy_gettext as _
from sqlalchemy import select
from sqlalchemy import or_, select
from sqlalchemy.orm import Session, eagerload

from api.controller.base import BaseCirculationManagerController
Expand All @@ -30,6 +30,7 @@
Loan,
get_one,
)
from core.model.library import Library
from core.problem_details import INVALID_INPUT
from core.util.problem_detail import ProblemDetail

Expand Down Expand Up @@ -209,7 +210,12 @@ def load_licensepools(self, library, identifier_type, identifier):
.where(
Identifier.type == identifier_type,
Identifier.identifier == identifier,
IntegrationLibraryConfiguration.library_id == library.id,
or_(
IntegrationLibraryConfiguration.library_id == library.id,
# Finland, collections from default library also included
IntegrationLibraryConfiguration.library_id
== Library.default(_db).id,
),
)
)
.unique()
Expand Down

0 comments on commit 8746904

Please sign in to comment.