mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
The key can't be in app_settings anymore because it got migrated ...
This commit is contained in:
parent
d4635f0eaa
commit
4e40f8b86a
1 changed files with 12 additions and 14 deletions
|
@ -1221,21 +1221,19 @@ def app_setting(app, key, value=None, delete=False):
|
|||
|
||||
# DELETE
|
||||
if delete:
|
||||
if key in app_settings:
|
||||
# If 'is_public' setting still exists, we interpret this as
|
||||
# coming from a legacy app (because new apps should manage the
|
||||
# is_public state themselves anymore...)
|
||||
#
|
||||
# In that case, we interpret the request for "deleting
|
||||
# unprotected/skipped" setting as willing to make the app
|
||||
# private
|
||||
if 'is_public' in app_settings and 'visitors' in permissions[app + ".main"]['allowed']:
|
||||
if key.startswith('unprotected_') or key.startswith('skipped_'):
|
||||
user_permission_update(app + ".main", remove="visitors")
|
||||
|
||||
# If 'is_public' setting still exists, we interpret this as
|
||||
# coming from a legacy app (because new apps should manage the
|
||||
# is_public state themselves anymore...)
|
||||
#
|
||||
# In that case, we interpret the request for "deleting
|
||||
# unprotected/skipped" setting as willing to make the app
|
||||
# private
|
||||
if 'is_public' in app_settings and 'visitors' in permissions[app + ".main"]['allowed']:
|
||||
if key.startswith('unprotected_') or key.startswith('skipped_'):
|
||||
user_permission_update(app + ".main", remove="visitors")
|
||||
else:
|
||||
if permission:
|
||||
permission_delete(permission_name)
|
||||
if permission:
|
||||
permission_delete(permission_name)
|
||||
|
||||
# SET
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue