Skip to content

Commit

Permalink
EKIRJASTO-131 Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
natlibfi-kaisa committed Dec 18, 2024
1 parent 33c7f1f commit 9fbf3ba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 7 additions & 3 deletions api/controller/loan.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ def borrow(self, identifier_type, identifier, mechanism_id=None):
work = self.load_work(library, identifier_type, identifier)
selected_book = patron.load_selected_book(work)


return OPDSAcquisitionFeed.single_entry_loans_feed(
self.circulation, loan_or_hold, selected_book=selected_book, **response_kwargs
self.circulation,
loan_or_hold,
selected_book=selected_book,
**response_kwargs,
)

def _borrow(self, patron, credential, pool, mechanism):
Expand Down Expand Up @@ -592,4 +594,6 @@ def detail(self, identifier_type, identifier):
item = loan
else:
item = hold
return OPDSAcquisitionFeed.single_entry_loans_feed(self.circulation, item, selected_book=selected_book)
return OPDSAcquisitionFeed.single_entry_loans_feed(
self.circulation, item, selected_book=selected_book
)
6 changes: 3 additions & 3 deletions api/controller/select_books.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ def _get_patron_loan_or_hold(self, patron, pools):
return item or pool

def detail(self, identifier_type, identifier):

"""
Return an OPDS feed entry for a selected book.
Expand All @@ -138,7 +137,6 @@ def detail(self, identifier_type, identifier):
return self.unselect(identifier_type, identifier)

if flask.request.method == "GET":

pools = self.load_licensepools(library, identifier_type, identifier)
if isinstance(pools, ProblemDetail):
return pools
Expand All @@ -148,4 +146,6 @@ def detail(self, identifier_type, identifier):
work = self.load_work(library, identifier_type, identifier)
selected_book = patron.load_selected_book(work)

return OPDSAcquisitionFeed.single_entry_loans_feed(self.circulation, item, selected_book=selected_book)
return OPDSAcquisitionFeed.single_entry_loans_feed(
self.circulation, item, selected_book=selected_book
)
5 changes: 3 additions & 2 deletions api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,9 @@ def selected_books():
return app.manager.select_books.fetch_books()


@library_route("/selected_books/<identifier_type>/<path:identifier>", methods=["GET", "DELETE"])
@library_route(
"/selected_books/<identifier_type>/<path:identifier>", methods=["GET", "DELETE"]
)
@has_library
@allows_patron_web
@requires_auth
Expand All @@ -427,7 +429,6 @@ def selected_book_detail(identifier_type, identifier):
return app.manager.select_books.detail(identifier_type, identifier)



@library_dir_route("/loans", methods=["GET", "HEAD"])
@has_library
@allows_patron_web
Expand Down

0 comments on commit 9fbf3ba

Please sign in to comment.