Skip to content

Commit

Permalink
A couple things from quick review
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Sep 5, 2024
1 parent cd331d7 commit 865b936
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
15 changes: 3 additions & 12 deletions src/palace/manager/api/controller/loan.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
)
from palace.manager.api.problem_details import (
BAD_DELIVERY_MECHANISM,
CANNOT_FULFILL,
CANNOT_RELEASE_HOLD,
HOLD_FAILED,
NO_ACTIVE_LOAN,
Expand Down Expand Up @@ -361,17 +360,9 @@ def fulfill(
except (CirculationException, RemoteInitiatedServerError) as e:
return e.problem_detail

if mechanism.delivery_mechanism.is_streaming:
if not isinstance(fulfillment, UrlFulfillment):
self.log.error(
"Fulfillment for streaming mechanism %r is not a URL: %r",
mechanism.delivery_mechanism,
fulfillment,
)
return CANNOT_FULFILL.with_debug(
"Incorrect fulfillment type: %r" % fulfillment
)

if mechanism.delivery_mechanism.is_streaming and isinstance(
fulfillment, UrlFulfillment
):
# If this is a streaming delivery mechanism, create an OPDS entry
# with a fulfillment link to the streaming reader url.
feed = OPDSAcquisitionFeed.single_entry_loans_feed(
Expand Down
5 changes: 1 addition & 4 deletions src/palace/manager/util/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import time
from collections.abc import Callable, Mapping, Sequence
from json import JSONDecodeError
from typing import TYPE_CHECKING, Any
from typing import Any
from urllib.parse import urlparse

import requests
Expand All @@ -28,9 +28,6 @@
ProblemDetailException,
)

if TYPE_CHECKING:
pass


class RemoteIntegrationException(IntegrationException, BaseProblemDetailException):
"""An exception that happens when we try and fail to communicate
Expand Down

0 comments on commit 865b936

Please sign in to comment.