[Fix #432] Stop raising a useless exception in get_position

When an accompagnateur, in the old UI, wants to
see a map, this call crashes because he’s not
the owner or invitee on the dossier he’s looking
at, therefore current_user_dossier raises an
exception
This commit is contained in:
gregoirenovel 2017-11-22 16:27:47 +01:00
parent abe1c3a3ea
commit 1d7e7fc654

View file

@ -31,7 +31,12 @@ class Users::CarteController < UsersController
end
def get_position
etablissement = current_user_dossier.etablissement
begin
etablissement = current_user_dossier.etablissement
rescue ActiveRecord::RecordNotFound
etablissement = nil
end
point = Carto::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse) unless etablissement.nil?
lon = '2.428462'