summaryrefslogtreecommitdiff
path: root/addons/document/static/src/js/document.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2018-08-28 14:51:46 +0000
committerNicolas Lempereur <nle@odoo.com>2018-09-28 10:42:51 +0000
commit46f2e1918fc6e135b1c82af19a13f9cb01c81470 (patch)
tree70ad4a6f8ee647f2b27e493e4c484198e4351535 /addons/document/static/src/js/document.js
parent2a697f1c5b06e741968dcd9b1f698ec5fc55f62e (diff)
[FIX] base: access_token error handling correctly
When an attachment is requested with an access_token, a server error would occur in some situation. With this changeset when an access token is specified: - returns a 404 error if the attachment does not exist - returns a 403 error if the attachment has no access_token Without this change, the added test would fail with: ``` status = test_access(access_token='Secret') self.assertEqual(status, 403, "no access if access token for attachment without access token") | if not consteq(obj.access_token, access_token): | TypeError: unsupported operand types(s) or combination of types: 'bool' and 'str' status = test_access(access_token='Secret') self.assertEqual(status, 404, "no access with access token for deleted attachment") | if not consteq(obj.access_token, access_token): | odoo.exceptions.MissingError: ('Record does not exist or has been deleted.', None) ``` close #26647 opw-1884419 closes #27275 Co-authored-by: Wolfgang Taferner <wtaferner@users.noreply.github.com>
Diffstat (limited to 'addons/document/static/src/js/document.js')
0 files changed, 0 insertions, 0 deletions