diff options
| author | Romain Estievenart <res@odoo.com> | 2021-01-21 12:16:19 +0000 |
|---|---|---|
| committer | Romain Estievenart <res@odoo.com> | 2021-01-22 12:23:15 +0000 |
| commit | f54c97f6214c235bac931184c6e533a7fa72fbe2 (patch) | |
| tree | 724d2b24667c3ade4529b8e35169b0376009f224 /addons | |
| parent | d6f27d568377ba23d859fefe02a33b07c678b233 (diff) | |
[FIX] http.py: exception handling parity in mono/multi db
The mobile app's authentication bases its feedback to the user on the
error message returned by the server.
Sadly, in case of multi-databases, no error message are properly
returned when the user provides wrong credentials (presenting only an
empty Snackbar).
This difference of behaviour was introduced in the commit
odoo/odoo@07d5ea3 which goals was to give more power for JsonRequest's
error handling customization. To do so, the catching of the exception
(if one happens) was delegated to the caller instead of the JsonRequest
itself.
This change indirectly introduced a difference about the treatment of an
exception between mono and multi-database :
* mono-database was already catching the exception and handling it
properly (see in
https://github.com/odoo/odoo/blob/f05f8ef647a4eaba49d8a20eb8068f1c7a702297/odoo/addons/base/models/ir_http.py#L235-L241).
* multi-databases didn't catch it.
This commit restores the parity between both use cases by applying the
same behaviour (as described in the commit odoo/odoo@07d5ea3):
```python
ir_http.dispatch():
try:
request.dispatch()
catch Exception as e:
ir_http._handle_exception(e)
ir_http.handle_exception(e)
request._handle_exception(e)
```
Steps to reproduce:
1. Open the mobile app;
2. Try to register an account with a wrong password with multiple
databases;
3. The snackbar is empty and no error is shown => bug;
Task ID: 2287176
closes odoo/odoo#64856
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Diffstat (limited to 'addons')
0 files changed, 0 insertions, 0 deletions
