[FIX] base: confusion between werkzeug.urls and urls local
As part of the Python 3 compatibility effort,
01e3514147 moved all uses of urllib(2)
to werkzeug & requests as the packages were renamed and reorganised
between P2 and P3.
For `module.py`, it looks like I confused the `urls` local variable
for an already imported `werkzeug.urls` and just tried calling
`url_parse` on that. Which doesn't work, because `urls` is a
dict.
Fixes #71076
closes odoo/odoo#71120
X-original-commit: 0cfe528de82c1de8971e5bb5f66103447eae781c
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
This commit is contained in:
@@ -15,6 +15,7 @@ import threading
|
||||
import zipfile
|
||||
|
||||
import requests
|
||||
import werkzeug.urls
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.core import publish_string
|
||||
@@ -792,7 +793,7 @@ class Module(models.Model):
|
||||
_logger.warning(msg)
|
||||
raise UserError(msg)
|
||||
|
||||
apps_server = urls.url_parse(self.get_apps_server())
|
||||
apps_server = werkzeug.urls.url_parse(self.get_apps_server())
|
||||
|
||||
OPENERP = odoo.release.product_name.lower()
|
||||
tmp = tempfile.mkdtemp()
|
||||
@@ -803,7 +804,7 @@ class Module(models.Model):
|
||||
if not url:
|
||||
continue # nothing to download, local version is already the last one
|
||||
|
||||
up = urls.url_parse(url)
|
||||
up = werkzeug.urls.url_parse(url)
|
||||
if up.scheme != apps_server.scheme or up.netloc != apps_server.netloc:
|
||||
raise AccessDenied()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user