diff options
| author | Debauche Stéphane <std@odoo.com> | 2019-12-02 15:11:05 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2019-12-20 12:24:43 +0000 |
| commit | 01dadaecca4577f7000fb8454bb65f42f1a3af7c (patch) | |
| tree | 5cb386f6e55f4854dfe9b4c4c5ce9e6c75686d57 /addons/website_slides/controllers | |
| parent | 7b0df05706ef83ea84badec60527e76015a05fb4 (diff) | |
[IMP] website_slides: improve error message when google API key is invalid
Currently when there is an issue with the google API key, a generic message
is send to the user, with the error details embedded in it in an ugly way.
Now a message is displayed: "Your Google API key is invalid, please update it
into your settings. Settings > Website > Features > API Key". This is done
by parsing the JSON google sends back after request and determining if the
error is linked to the API key.
Task #2082857
closes odoo/odoo#40547
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_slides/controllers')
| -rw-r--r-- | addons/website_slides/controllers/main.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_slides/controllers/main.py b/addons/website_slides/controllers/main.py index e183045e062..fbebb1613be 100644 --- a/addons/website_slides/controllers/main.py +++ b/addons/website_slides/controllers/main.py @@ -883,7 +883,7 @@ class WebsiteSlides(WebsiteProfile): return preview values = Slide._parse_document_url(data['url'], only_preview_fields=True) if values.get('error'): - preview['error'] = _('Could not fetch data from url. Document or access right not available.\nHere is the received response: %s') % values['error'] + preview['error'] = values['error'] return preview return values |
