Merge pull request #402 from YunoHost/app_info_change_url

[enh] make change_url possibility available on the API for the admin
This commit is contained in:
Laurent Peuch 2018-01-07 18:42:47 +01:00 committed by GitHub
commit 93fee93a58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -330,6 +330,9 @@ def app_info(app, show_status=False, raw=False):
if not _is_installed(app):
raise MoulinetteError(errno.EINVAL,
m18n.n('app_not_installed', app=app))
app_setting_path = APPS_SETTING_PATH + app
if raw:
ret = app_list(filter=app, raw=True)[app]
ret['settings'] = _get_app_settings(app)
@ -345,11 +348,10 @@ def app_info(app, show_status=False, raw=False):
upgradable = "no"
ret['upgradable'] = upgradable
ret['change_url'] = os.path.exists(os.path.join(app_setting_path, "scripts", "change_url"))
return ret
app_setting_path = APPS_SETTING_PATH + app
# Retrieve manifest and status
with open(app_setting_path + '/manifest.json') as f:
manifest = json.loads(str(f.read()))