Skip to content

Commit

Permalink
corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Abderrahim AZIME committed Jul 19, 2023
1 parent b327f9a commit 0ed08a5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions source/jormungandr/jormungandr/scenarios/new_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -1333,10 +1333,6 @@ def fill_journeys(self, request_type, api_request, instance):
api_request.get('destination'), instance, request_id="{}_dest_detail".format(request_id)
)

# Transform address in from/to to poi with ES
origin_detail = transform_entrypoint(origin_detail, api_request.get('origin'))
destination_detail = transform_entrypoint(destination_detail, api_request.get('destination'))

# we store the origin/destination detail in g to be able to use them after the marshall
g.origin_detail = origin_detail
g.destination_detail = destination_detail
Expand Down Expand Up @@ -1755,14 +1751,17 @@ def get_entrypoint_detail(self, entrypoint, instance, request_id):
)

if detail:
return detail
# Transform address in (from, to) to poi with ES
return transform_entrypoint(detail, entrypoint)

if not isinstance(instance.autocomplete, GeocodeJson):
bragi = global_autocomplete.get(app.config.get('DEFAULT_AUTOCOMPLETE_BACKEND', 'bragi'))
if bragi:
# if the instance's autocomplete is not a geocodejson autocomplete, we also check in the
# global autocomplete instance
return bragi.get_object_by_uri(entrypoint, instances=[instance], request_id=request_id)
detail = bragi.get_object_by_uri(entrypoint, instances=[instance], request_id=request_id)
# Transform address in (from, to) to poi with ES
return transform_entrypoint(detail, entrypoint)

return None

Expand Down

0 comments on commit 0ed08a5

Please sign in to comment.