From 34220c9a5eb740b7b4a06c85a74351f407d1ec56 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Fri, 28 Jun 2024 16:43:08 +0200 Subject: [PATCH] service: fix request ID passing --- invenio_requests/services/events/service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/invenio_requests/services/events/service.py b/invenio_requests/services/events/service.py index 9b508f4c..d97fe60c 100644 --- a/invenio_requests/services/events/service.py +++ b/invenio_requests/services/events/service.py @@ -75,7 +75,7 @@ def create( event = self.record_cls.create( {}, request=request.model, - request_id=str(request_id), + request_id=str(request.id), type=event_type, ) event.update(data) @@ -204,7 +204,7 @@ def search( params, search_preference, permission_action="unused", - extra_filter=dsl.Q("term", request_id=str(request_id)), + extra_filter=dsl.Q("term", request_id=str(request.id)), **kwargs, ) search_result = search.execute() @@ -216,7 +216,7 @@ def search( params, links_tpl=LinksTemplate( self.config.links_search, - context={"request_id": request_id, "args": params}, + context={"request_id": str(request.id), "args": params}, ), links_item_tpl=self.links_item_tpl, expandable_fields=self.expandable_fields,