From de71a1f13db4ab28d2f82f444ead80c2b66a992c Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Fri, 28 Jun 2024 16:14:19 +0200 Subject: [PATCH] service: handle request parameters flexibly --- invenio_requests/services/events/service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/invenio_requests/services/events/service.py b/invenio_requests/services/events/service.py index f987d0f4..9b508f4c 100644 --- a/invenio_requests/services/events/service.py +++ b/invenio_requests/services/events/service.py @@ -231,6 +231,9 @@ def request_cls(self): def _get_request(self, request_id): """Get associated request.""" + # If it's already a request, return it + if isinstance(request_id, self.request_cls): + return request_id return self.request_cls.get_record(request_id) def _get_event(self, event_id, with_deleted=True):