mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fix regex manamgement
This commit is contained in:
parent
52e2be8fe6
commit
530d94b2ca
1 changed files with 5 additions and 3 deletions
|
@ -391,7 +391,8 @@ def permission_url(operation_logger, permission,
|
|||
else:
|
||||
url = _check_and_normalize_permission_path(url)
|
||||
domain, path = _get_full_url(url, app_main_path).split('/', 1)
|
||||
conflicts = _get_conflicting_apps(domain.lstrip("re:"), path, ignore_app=permission.split('.')[0])
|
||||
domain = domain[3:] if domain.startswith("re:") else domain
|
||||
conflicts = _get_conflicting_apps(domain, path, ignore_app=permission.split('.')[0])
|
||||
if url.startswith('re:') and existing_permission['show_tile']:
|
||||
logger.warning(m18n.n('regex_incompatible_with_tile', regex=url, permission=permission))
|
||||
show_tile = False
|
||||
|
@ -418,7 +419,8 @@ def permission_url(operation_logger, permission,
|
|||
else:
|
||||
ur = _check_and_normalize_permission_path(ur)
|
||||
domain, path = _get_full_url(ur, app_main_path).split('/', 1)
|
||||
conflicts = _get_conflicting_apps(domain.lstrip("re:"), path, ignore_app=permission.split('.')[0])
|
||||
domain = domain[3:] if domain.startswith("re:") else domain
|
||||
conflicts = _get_conflicting_apps(domain, path, ignore_app=permission.split('.')[0])
|
||||
|
||||
if conflicts:
|
||||
apps = []
|
||||
|
@ -655,6 +657,6 @@ def _get_full_url(url, app_main_path):
|
|||
if url.startswith('/'):
|
||||
return app_main_path + url.rstrip("/")
|
||||
if url.startswith('re:/'):
|
||||
return 're:' + app_main_path + url.lstrip('re:')
|
||||
return 're:' + app_main_path + url[3:]
|
||||
else:
|
||||
return url
|
||||
|
|
Loading…
Add table
Reference in a new issue