1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

selectively clear sesh on pass change

This commit is contained in:
adamscmRH 2018-07-11 10:29:16 -04:00
parent 630cdce244
commit e99d922261

View File

@ -925,7 +925,8 @@ class UserSerializer(BaseSerializer):
if new_password:
obj.set_password(new_password)
obj.save(update_fields=['password'])
UserSessionMembership.clear_session_for_user(obj)
if self.context['request'].user != obj:
UserSessionMembership.clear_session_for_user(obj)
elif not obj.password:
obj.set_unusable_password()
obj.save(update_fields=['password'])