Skip to content

Commit 407cc86

Browse files
committed
fix(spp_gis): treat default placeholder API key as unconfigured
The default system parameter value "YOUR_MAPTILER_API_KEY_HERE" was being returned as a valid key, causing 403 errors from MapTiler instead of falling back to OSM tiles.
1 parent d750b6a commit 407cc86

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

spp_gis/controllers/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ class MainController(http.Controller):
77
def get_maptiler_api_key(self):
88
# nosemgrep: odoo-sudo-without-context
99
map_tiler_api_key = request.env["ir.config_parameter"].sudo().get_param("spp_gis.map_tiler_api_key")
10+
# Treat the default placeholder as "not configured"
11+
if map_tiler_api_key == "YOUR_MAPTILER_API_KEY_HERE":
12+
map_tiler_api_key = False
1013
# nosemgrep: odoo-sudo-without-context
1114
web_base_url = request.env["ir.config_parameter"].sudo().get_param("web.base.url")
1215
return {"mapTilerKey": map_tiler_api_key, "webBaseUrl": web_base_url}

0 commit comments

Comments
 (0)