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

Merge pull request #2486 from rooftopcellist/fix_change_pass

selectively clear sesh on pass change
This commit is contained in:
Christian Adams 2018-07-11 10:59:06 -04:00 committed by GitHub
commit 6ac17c874f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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'])