Skip to content

Commit

Permalink
fix(ill_request): permissions failed
Browse files Browse the repository at this point in the history
Co-Authored-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr committed Feb 15, 2024
1 parent 4f1de3b commit a9f180e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rero_ils/modules/ill_requests/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ def _postprocess_search_hit(self, hit: dict) -> None:
"""Post-process each hit of a search result."""
metadata = hit.get('metadata', {})
if pid := metadata.get('pickup_location', {}).get('pid'):
location = self.get_resource(LocationsSearch(), pid)
pickup_name = location.get('ill_pickup_name', location.get('name'))
metadata['pickup_location']['name'] = pickup_name
if location := self.get_resource(LocationsSearch(), pid):
pickup_name = location.get('ill_pickup_name', location.get('name'))
metadata['pickup_location']['name'] = pickup_name
else:
metadata['pickup_location']['name'] = '[Deleted]'
super()._postprocess_search_hit(hit)

def _postprocess_search_aggregations(self, aggregations: dict) -> None:
Expand Down

0 comments on commit a9f180e

Please sign in to comment.