sso/backends: remove_* must not change the user (#13430)

_update_m2m_from_groups must return None if remove_* is false or empty,
because None indicates that the user permissions will not be changed.

related #13429
This commit is contained in:
anxstj 2023-01-26 21:38:43 +01:00 committed by GitHub
parent 61821faa00
commit d7025a919c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -354,7 +354,9 @@ def _update_m2m_from_groups(ldap_user, opts, remove=True):
continue
if ldap_user._get_groups().is_member_of(group_dn):
return True
return False
if remove:
return False
return None
@receiver(populate_user, dispatch_uid='populate-ldap-user')