diff --git a/src/palace/manager/api/controller/odl_notification.py b/src/palace/manager/api/controller/odl_notification.py index 3e45ff4de..e1ddcea80 100644 --- a/src/palace/manager/api/controller/odl_notification.py +++ b/src/palace/manager/api/controller/odl_notification.py @@ -21,7 +21,6 @@ from palace.manager.sqlalchemy.model.credential import Credential from palace.manager.sqlalchemy.model.licensing import License from palace.manager.sqlalchemy.model.patron import Loan, Patron -from palace.manager.sqlalchemy.util import get_one from palace.manager.util.datetime_helpers import utc_now from palace.manager.util.log import LoggerMixin from palace.manager.util.problem_detail import ProblemDetailException @@ -63,12 +62,6 @@ def notify( loan = self._get_loan(patron_identifier, license_identifier) return self._process_notification(loan) - # TODO: This method is deprecated and should be removed once all the loans - # created using the old endpoint have expired. - def notify_deprecated(self, loan_id: int) -> Response: - loan = get_one(self.db, Loan, id=loan_id) - return self._process_notification(loan) - def _process_notification(self, loan: Loan | None) -> Response: status_doc_json = flask.request.data diff --git a/src/palace/manager/api/routes.py b/src/palace/manager/api/routes.py index b521637c7..583fcd2b5 100644 --- a/src/palace/manager/api/routes.py +++ b/src/palace/manager/api/routes.py @@ -580,16 +580,6 @@ def saml_callback(): ) -# TODO: This is a deprecated route that will be removed in a future release of the code, -# its left here for now to provide a dummy endpoint for existing ODL loans. All -# new loans will use the new endpoint. -@library_route("/odl_notify/", methods=["GET", "POST"]) -@has_library -@raises_problem_detail -def odl_notify(loan_id) -> Response: - return app.manager.odl_notification_controller.notify_deprecated(loan_id) - - # Loan notifications for OPDS + ODL distributors @library_route("/odl/notify//", methods=["POST"]) @has_library diff --git a/tests/manager/api/controller/test_odl_notify.py b/tests/manager/api/controller/test_odl_notify.py index f02433b1a..408965b4b 100644 --- a/tests/manager/api/controller/test_odl_notify.py +++ b/tests/manager/api/controller/test_odl_notify.py @@ -167,27 +167,6 @@ def test_notify_success( assert loan.end == utc_now() - @freeze_time() - def test_notify_deprecated( - self, - flask_app_fixture: FlaskAppFixture, - odl_fixture: ODLFixture, - ) -> None: - loan = odl_fixture.create_loan() - assert loan.end != utc_now() - status_doc = odl_fixture.loan_status_document("revoked") - with flask_app_fixture.test_request_context( - "/", - method="POST", - data=status_doc.model_dump_json(), - library=odl_fixture.library, - ): - assert loan.id is not None - response = odl_fixture.controller.notify_deprecated(loan.id) - assert response.status_code == 204 - - assert loan.end == utc_now() - def test_notify_errors( self, db: DatabaseTransactionFixture, diff --git a/tests/manager/api/test_routes.py b/tests/manager/api/test_routes.py index efba68037..325f1abd7 100644 --- a/tests/manager/api/test_routes.py +++ b/tests/manager/api/test_routes.py @@ -415,13 +415,6 @@ def fixture(self, route_test: RouteTestFixture) -> RouteTestFixture: route_test.set_controller_name(self.CONTROLLER_NAME) return route_test - def test_odl_notify_deprecated(self, fixture: RouteTestFixture): - url = "/odl_notify/" - fixture.assert_request_calls( - url, fixture.controller.notify_deprecated, "" - ) - fixture.assert_supported_methods(url, "GET", "POST") - def test_odl_notify(self, fixture: RouteTestFixture): url = "/odl/notify//" fixture.assert_request_calls(