diff --git a/api/odl.py b/api/odl.py index 5d42046bc4..305a4c389a 100644 --- a/api/odl.py +++ b/api/odl.py @@ -1244,11 +1244,12 @@ def _detail_for_elementtree_entry( concurrent_checkouts = subtag(terms[0], "odl:concurrent_checkouts") expires = subtag(terms[0], "odl:expires") - if concurrent_checkouts is not None: - concurrent_checkouts_int = int(concurrent_checkouts) - - if expires is not None: - expires_datetime = to_utc(dateutil.parser.parse(expires)) + concurrent_checkouts_int = ( + int(concurrent_checkouts) if concurrent_checkouts is not None else None + ) + expires_datetime = ( + to_utc(dateutil.parser.parse(expires)) if expires is not None else None + ) if not odl_status_link: parsed_license = None diff --git a/tests/api/test_odl.py b/tests/api/test_odl.py index b483f71901..518e6cf4de 100644 --- a/tests/api/test_odl.py +++ b/tests/api/test_odl.py @@ -1242,7 +1242,7 @@ def test_release_hold_success( odl_api_test_fixture.checkout(patron=loan_patron) odl_api_test_fixture.pool.on_hold_to(odl_api_test_fixture.patron, position=1) - assert True == odl_api_test_fixture.api.release_hold( + odl_api_test_fixture.api.release_hold( odl_api_test_fixture.patron, "pin", odl_api_test_fixture.pool ) assert 0 == odl_api_test_fixture.pool.licenses_available @@ -1253,7 +1253,7 @@ def test_release_hold_success( odl_api_test_fixture.pool.on_hold_to(odl_api_test_fixture.patron, position=0) odl_api_test_fixture.checkin(patron=loan_patron) - assert True == odl_api_test_fixture.api.release_hold( + odl_api_test_fixture.api.release_hold( odl_api_test_fixture.patron, "pin", odl_api_test_fixture.pool ) assert 1 == odl_api_test_fixture.pool.licenses_available @@ -1266,7 +1266,7 @@ def test_release_hold_success( db.patron(), position=2 ) - assert True == odl_api_test_fixture.api.release_hold( + odl_api_test_fixture.api.release_hold( odl_api_test_fixture.patron, "pin", odl_api_test_fixture.pool ) assert 0 == odl_api_test_fixture.pool.licenses_available