mirror of
https://github.com/odoo/documentation.git
synced 2025-12-12 07:29:27 +07:00
[FIX] core/github_link: deprecated werkzeug method
Latest versions of werkzeug do not provide url_unparse anymore, leading to an error during the build: AttributeError: module 'werkzeug.urls' has no attribute 'url_unparse' This commit replaces the use of url_unparse by the urllib counterpart. closes odoo/documentation#12246 Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
@@ -23,8 +23,8 @@ import importlib
|
|||||||
import inspect
|
import inspect
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
import werkzeug
|
|
||||||
import contextlib
|
import contextlib
|
||||||
|
from urllib.parse import urlunsplit
|
||||||
|
|
||||||
|
|
||||||
def setup(app):
|
def setup(app):
|
||||||
@@ -93,7 +93,7 @@ def make_github_link(app, project, path, line=None, mode="blob"):
|
|||||||
branch = 'master'
|
branch = 'master'
|
||||||
|
|
||||||
urlpath = f"/{app.config.github_user}/{project}/{mode}/{branch}/{path}"
|
urlpath = f"/{app.config.github_user}/{project}/{mode}/{branch}/{path}"
|
||||||
return werkzeug.urls.url_unparse((
|
return urlunsplit((
|
||||||
'https',
|
'https',
|
||||||
'github.com',
|
'github.com',
|
||||||
urlpath,
|
urlpath,
|
||||||
|
|||||||
Reference in New Issue
Block a user