diff --git a/elastic/views.py b/elastic/views.py index 2fb3665..86c686f 100644 --- a/elastic/views.py +++ b/elastic/views.py @@ -1264,6 +1264,10 @@ def add_key_view(request): request.session.modified = True except Exception: pass + cur_manage = [str(x).strip() for x in list((me or {}).get("manage_key") or []) if str(x).strip()] + if key_name not in cur_manage: + cur_manage.append(key_name) + es_update_user_by_id(uid, manage_key=cur_manage) elif can_manage_reg: cur = [str(x).strip() for x in list((me or {}).get("registration_manage_keys") or []) if str(x).strip()] if key_name not in cur: