Skip to content

Commit

Permalink
service: handle request parameters flexibly
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Jun 28, 2024
1 parent 0f360f5 commit de71a1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions invenio_requests/services/events/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit de71a1f

Please sign in to comment.