diff options
| author | Adrian Torres <adt@odoo.com> | 2018-11-08 15:27:30 +0000 |
|---|---|---|
| committer | Adrian Torres <adt@odoo.com> | 2018-11-29 09:28:17 +0000 |
| commit | 52f5528cfb6d1152ee226e268247dc685a8ba329 (patch) | |
| tree | b44ecfa477b50dd3e488f09f623eecc8bc8e9d7d /addons/website/controllers/main.py | |
| parent | e5c864a596b72515837f0ed1e07550398ecc1ab0 (diff) | |
[REF] *: replace deprecated pycompat helpers for builtins
This commit replaces calls to pycompat helpers that were intended for
python 2 <-> python 3 interoperability for python 3 builtins, as python
2 is no longer officially supported by Odoo.
This includes:
* calls to imap/izip/ifilter replaced by map/zip/filter
* uses of text_type replaced by str
* uses of unichr replaced by chr
* calls to implements_to_string, implements_iterator removed
* string_types and integer_types replaced by str, int respectively
* calls to to_native replaced by calls to to_text
This is done in preparation to the removal of these deprecated helpers
in the following commit.
Diffstat (limited to 'addons/website/controllers/main.py')
| -rw-r--r-- | addons/website/controllers/main.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index e68d208fb52..50f1373665a 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -16,7 +16,7 @@ import odoo from odoo import http, models, fields, _ from odoo.http import request -from odoo.tools import pycompat, OrderedSet +from odoo.tools import OrderedSet from odoo.addons.http_routing.models.ir_http import slug, _guess_mimetype from odoo.addons.web.controllers.main import Binary from odoo.addons.portal.controllers.portal import pager as portal_pager @@ -410,7 +410,7 @@ class Website(Home): action = action_id = None # find the action_id: either an xml_id, the path, or an ID - if isinstance(path_or_xml_id_or_id, pycompat.string_types) and '.' in path_or_xml_id_or_id: + if isinstance(path_or_xml_id_or_id, str) and '.' in path_or_xml_id_or_id: action = request.env.ref(path_or_xml_id_or_id, raise_if_not_found=False) if not action: action = ServerActions.search([('website_path', '=', path_or_xml_id_or_id), ('website_published', '=', True)], limit=1) |
