Skip to content

Commit

Permalink
EKIR-213 Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
natlibfi-kaisa committed Sep 17, 2024
1 parent 96913e2 commit 38d9de5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 3 additions & 5 deletions api/circulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,12 +1083,10 @@ def borrow(
raise CannotRenew(
_("You cannot renew a loan if other patrons have the work on hold.")
)

# The patron had a hold and was in the hold queue's 0th position believing
# there were copies available for them to checkout.
if (
existing_hold and existing_hold.position == 0
):
if existing_hold and existing_hold.position == 0:
# Update the hold so the patron doesn't lose their hold. Extend the hold to expire in the
# next 3 days.
hold_info = HoldInfo(
Expand Down Expand Up @@ -1260,7 +1258,7 @@ def enforce_limits(self, patron: Patron, pool: LicensePool) -> None:
# This patron can take out either a loan or a hold, so the
# limits don't apply.
return

if not at_loan_limit and at_hold_limit:
# This patron can take out a loan, but not a hold. This is relevant when
# the patron can't place a hold but can take out a loan.
Expand Down
2 changes: 0 additions & 2 deletions tests/api/test_circulationapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,6 @@ def patron_at_hold_limit(self, patron):
assert patron == circulation.patron_at_hold_limit_calls.pop()
assert [] == api.availability_updated


# If the book is available, we're fine -- we're not at our loan limit.
# The remote API isn't queried for updated availability
# information for this LicensePool.
Expand All @@ -896,7 +895,6 @@ def patron_at_hold_limit(self, patron):
assert patron == circulation.patron_at_hold_limit_calls.pop()
assert [] == api.availability_updated


def test_borrow_hold_limit_reached(
self, circulation_api: CirculationAPIFixture, library_fixture: LibraryFixture
):
Expand Down

0 comments on commit 38d9de5

Please sign in to comment.