mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Simplify small piece of code
This commit is contained in:
parent
db9d2aac30
commit
2d3dee8d41
1 changed files with 6 additions and 4 deletions
|
@ -376,11 +376,13 @@ def permission_url(operation_logger, permission,
|
|||
permission = permission + ".main"
|
||||
|
||||
if url or add_url:
|
||||
if app_setting(permission.split('.')[0], 'domain') is None or app_setting(permission.split('.')[0], 'path') is None:
|
||||
raise YunohostError('unknown_main_domain_path', app=permission.split('.')[0])
|
||||
app = permission.split('.')[0]
|
||||
domain = app_setting(app, 'domain')
|
||||
path = app_setting(app, 'path')
|
||||
if domain is None or path is None:
|
||||
raise YunohostError('unknown_main_domain_path', app=app)
|
||||
else:
|
||||
# App main path in setting to manage conflict
|
||||
app_main_path = app_setting(permission.split('.')[0], 'domain') + app_setting(permission.split('.')[0], 'path')
|
||||
app_main_path = domain + path
|
||||
|
||||
# Fetch existing permission
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue