[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:
parent
abe1c3a3ea
commit
1d7e7fc654
1 changed files with 6 additions and 1 deletions
|
@ -31,7 +31,12 @@ class Users::CarteController < UsersController
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_position
|
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?
|
point = Carto::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse) unless etablissement.nil?
|
||||||
|
|
||||||
lon = '2.428462'
|
lon = '2.428462'
|
||||||
|
|
Loading…
Add table
Reference in a new issue