Skip to content

Commit

Permalink
Merge pull request #89 from NatLibFi/Revert-loan-and-hold-limit
Browse files Browse the repository at this point in the history
Change operators > back to >=
  • Loading branch information
natlibfi-psams authored Aug 9, 2024
2 parents cb5f7a3 + 165f73c commit 8872714
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/odl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _checkout(
patron.loans,
)
)
if len(loans) > self.loan_limit: # Changed operator >= to >
if len(loans) >= self.loan_limit: # Changed back operator > to >=
raise PatronLoanLimitReached(limit=self.loan_limit)
return super()._checkout(patron, licensepool, hold)

Expand All @@ -125,7 +125,7 @@ def _place_hold(self, patron: Patron, licensepool: LicensePool) -> HoldInfo:
patron.holds,
)
)
if len(holds) > self.hold_limit: # Changed operator >= to >
if len(holds) >= self.hold_limit: # Changed back operator > to >=
raise PatronHoldLimitReached(limit=self.hold_limit)
return super()._place_hold(patron, licensepool)

Expand Down

0 comments on commit 8872714

Please sign in to comment.