diff options
| author | Romain Derie <rde@odoo.com> | 2019-02-12 18:27:15 +0000 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2019-03-14 10:28:02 +0000 |
| commit | 25a8b507b130453439bcf727e5a9ed087418cc84 (patch) | |
| tree | 46704eb38c7d9fd4f86714146e47c388dfd9bc6f /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | 29423872b1b183c76093dcf27468961d718634f3 (diff) | |
[FIX] website, website_sale: create utility method to check if frontend
Before this commit, at multiple places to check if we were in a frontend
context we would check if `request and hasattr(request, 'website')` and
then access `request.website`.
Now, we call an utility method to get that website if we are in a frontend
context. If not the method will return False.
This method will be usefull for incoming pricelist fixes & tests.
Indeed, we will have more check of that kind and this will be easier to mock as
mocking this method will be enough, instead of mocking every method doing that
if condition to simulate a frontend context (to do website tests in python
wihout having to go frontend with a tour).
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
