Skip to content

Commit

Permalink
Move around none check
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Sep 25, 2024
1 parent 0374108 commit 1e2205b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/palace/manager/sqlalchemy/model/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,6 @@ def default_loan_period(
that someone who borrows a non-open-access item from this
collection has it for this number of days.
"""
if library is None:
return self.STANDARD_DEFAULT_LOAN_PERIOD
value = (
self.default_loan_period_setting(library, medium)
or self.STANDARD_DEFAULT_LOAN_PERIOD
Expand All @@ -338,13 +336,16 @@ def loan_period_key(cls, medium: str = EditionConstants.BOOK_MEDIUM) -> str:

def default_loan_period_setting(
self,
library: Library,
library: Library | None,
medium: str = EditionConstants.BOOK_MEDIUM,
) -> int | None:
"""Until we hear otherwise from the license provider, we assume
that someone who borrows a non-open-access item from this
collection has it for this number of days.
"""
if library is None:
return None

Check warning on line 347 in src/palace/manager/sqlalchemy/model/collection.py

View check run for this annotation

Codecov / codecov/patch

src/palace/manager/sqlalchemy/model/collection.py#L347

Added line #L347 was not covered by tests

key = self.loan_period_key(medium)

config = self.integration_configuration.for_library(library)
Expand Down

0 comments on commit 1e2205b

Please sign in to comment.