File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
# English strings go here for Rails i18n
2
2
en :
3
3
error_invalid_json : must be valid JSON
4
+ error_unable_to_update_project_gtt_settings : " Unable to update project GTT settings (%{value})"
4
5
5
6
field_default : Default for new projects
6
7
field_geometry : " Geometry"
Original file line number Diff line number Diff line change 1
1
# Japanese strings go here for Rails i18n
2
2
ja :
3
3
error_invalid_json : " 正しいJSONにしてください"
4
+ error_unable_to_update_project_gtt_settings : " プロジェクトのGTTの設定を更新できません (%{value})"
4
5
5
6
field_default : " 新規プロジェクトのデフォルト"
6
7
field_geometry : " 所在地"
Original file line number Diff line number Diff line change @@ -26,7 +26,13 @@ def update_project
26
26
if tile_source_ids = @form . gtt_tile_source_ids
27
27
@project . gtt_tile_source_ids = tile_source_ids
28
28
end
29
- @project . geojson = @form . geojson
29
+
30
+ begin
31
+ @project . geojson = @form . geojson
32
+ rescue RGeo ::Error ::InvalidGeometry => e
33
+ @project . errors . add ( :geom , :invalid )
34
+ return false
35
+ end
30
36
31
37
@project . save
32
38
end
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ def update_gtt_configuration
47
47
if r . settings_saved?
48
48
flash . now [ :notice ] = l ( :notice_successful_update )
49
49
else
50
- flash . now [ :error ] = r . error
50
+ flash . now [ :error ] = l ( :error_unable_to_update_project_gtt_settings , " #{ r . error } " )
51
51
end
52
52
53
53
end
You can’t perform that action at this time.
0 commit comments