Skip to content

Commit

Permalink
Merge branch 'main' into python3
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Jul 30, 2021
2 parents 15043e3 + 9c0169e commit d0076ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/circulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,8 +1057,8 @@ def revoke_loan(self, patron, pin, licensepool):
on_multiple='interchangeable'
)
if loan:
if not licensepool.open_access and not licensepool.self_hosted:
api = self.api_for_license_pool(licensepool)
api = self.api_for_license_pool(licensepool)
if not (api is None or licensepool.open_access or licensepool.self_hosted):
try:
api.checkin(patron, pin, licensepool)
except NotCheckedOut as e:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_circulationapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,8 @@ def yes_we_can(*args, **kwargs):

@parameterized.expand([
('open_access', True, False),
('self_hosted', False, True)
('self_hosted', False, True),
('neither', False, False),
])
def test_revoke_loan(self, _, open_access=False, self_hosted=False):
self.pool.open_access = open_access
Expand Down

0 comments on commit d0076ec

Please sign in to comment.