Merge pull request #5935 from FinnStutzenstein/userAutoupdateOnPermissionChange
Update users on can_see_extra_data permission change
This commit is contained in:
commit
bd7fa9b3db
@ -15,11 +15,11 @@ def get_permission_change_data(sender, permissions=None, **kwargs):
|
||||
users_app = apps.get_app_config(app_label="users")
|
||||
for permission in permissions:
|
||||
# There could be only one 'users.can_see_name' and then we want to return data.
|
||||
if (
|
||||
permission.content_type.app_label == users_app.label
|
||||
and permission.codename == "can_see_name"
|
||||
):
|
||||
yield from users_app.get_startup_elements()
|
||||
if permission.content_type.app_label == users_app.label:
|
||||
if permission.codename == "can_see_name":
|
||||
yield from users_app.get_startup_elements()
|
||||
elif permission.codename == "can_see_extra_data":
|
||||
yield users_app.get_model("User")
|
||||
|
||||
|
||||
def create_builtin_groups_and_admin(**kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user