Translate msg when providing incorrect old password

This commit is contained in:
Oskar Persson 2018-11-09 15:58:09 +01:00
parent 479a40d2cc
commit c437ca22ff

View File

@ -256,7 +256,8 @@ class PasswordChangeSerializer(serializers.Serializer):
)
if all(invalid_password_conditions):
raise serializers.ValidationError('Invalid password')
err_msg = _("Your old password was entered incorrectly. Please enter it again.")
raise serializers.ValidationError(err_msg)
return value
def validate(self, attrs):