Skip to content

Commit

Permalink
change error message (#7193)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael18811380328 authored Dec 16, 2024
1 parent 156de7f commit 034d756
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const UserSetPassword = ({ toggle }) => {
return;
}
if (!validatePassword(password)) {
setErrorMessage(gettext('Insufficient password strength'));
setErrorMessage(gettext('Password strength should be strong or very strong'));
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const UserUpdatePassword = ({ toggle }) => {
setErrorMessage(gettext('New password cannot be the same as old password'));
}
if (!validatePassword(newPassword)) {
setErrorMessage(gettext('Insufficient password strength'));
setErrorMessage(gettext('Password strength should be strong or very strong'));
return;
}
setErrorMessage('');
Expand Down
2 changes: 1 addition & 1 deletion seahub/api2/endpoints/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def post(self, request):
return api_error(status.HTTP_400_BAD_REQUEST, 'New password cannot be the same as old password')

if not is_password_strength_valid(new_password):
return api_error(status.HTTP_400_BAD_REQUEST, 'Insufficient password strength')
return api_error(status.HTTP_400_BAD_REQUEST, 'Password strength should be strong or very strong')

user = request.user
if user.enc_password != UNUSABLE_PASSWORD and not old_password:
Expand Down
2 changes: 1 addition & 1 deletion seahub/templates/snippets/password_strength_js.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
return (typeof (window) !== 'undefined') && (window.innerWidth < 768 || navigator.userAgent.toLowerCase().match(/(ipod|ipad|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null);
}

var passwd_tip = "{% blocktrans %}Insufficient password strength{% endblocktrans%}";
var passwd_tip = "{% blocktrans %}Password strength should be strong or very strong{% endblocktrans%}";

var template = `
<div class="popover show registration-form-popover" role="tooltip">
Expand Down

0 comments on commit 034d756

Please sign in to comment.