Merge pull request #481 from OskarPersson/old-password-error-msg

Use translated msg when providing incorrect old password
This commit is contained in:
mario 2019-04-18 19:58:54 +02:00 committed by GitHub
commit 4cf813262f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -256,7 +256,8 @@ class PasswordChangeSerializer(serializers.Serializer):
) )
if all(invalid_password_conditions): 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 return value
def validate(self, attrs): def validate(self, attrs):