admin update user roles - permissions cache warning

This commit is contained in:
rimu 2024-02-28 10:38:44 +13:00
parent 259d7c619c
commit 3c16859bfe

View file

@ -559,6 +559,8 @@ def admin_user_edit(user_id):
if role.id != form.role.data: if role.id != form.role.data:
user.roles.remove(role) user.roles.remove(role)
user.roles.append(Role.query.get(form.role.data)) user.roles.append(Role.query.get(form.role.data))
if form.role.data == 4:
flash(_("Permissions are cached for 50 seconds so new admin roles won't take effect immediately."))
db.session.commit() db.session.commit()
user.flush_cache() user.flush_cache()