mirror of
https://github.com/suitenumerique/people
synced 2026-04-25 17:15:13 +02:00
🚸(mailboxes) improve error message when no secondary email
improve error message when trying to reset password on a mailbox not having a secondary email.
This commit is contained in:
committed by
Marie
parent
6c8ded9904
commit
06dcdf275a
@@ -15,6 +15,7 @@ and this project adheres to
|
||||
### Fixed
|
||||
|
||||
- 🐛(dimail) fix no import for functional mailboxes
|
||||
- 🚸(mailboxes) improve error message when no secondary email
|
||||
|
||||
## [1.24.0] - 2026-03-24
|
||||
|
||||
|
||||
@@ -75,8 +75,7 @@ def test_api_mailboxes__reset_password_no_secondary_email():
|
||||
client = APIClient()
|
||||
client.force_login(access.user)
|
||||
|
||||
error = "Password reset requires a secondary email address. \
|
||||
Please add a valid secondary email before trying again."
|
||||
error = "Please add a secondary email before resetting the password."
|
||||
|
||||
# Mailbox with no secondary email
|
||||
mailbox = factories.MailboxEnabledFactory(domain=mail_domain, secondary_email=None)
|
||||
|
||||
@@ -652,7 +652,7 @@ class DimailAPIClient:
|
||||
"""Send a request to reset mailbox password."""
|
||||
if not mailbox.secondary_email or mailbox.secondary_email == str(mailbox):
|
||||
raise exceptions.ValidationError(
|
||||
"Password reset requires a secondary email address. Please add a valid secondary email before trying again."
|
||||
_("Please add a secondary email before resetting the password.")
|
||||
)
|
||||
|
||||
try:
|
||||
|
||||
@@ -67,7 +67,11 @@ export const PanelActions = ({ mailDomain, mailbox }: PanelActionsProps) => {
|
||||
{
|
||||
onSuccess: () =>
|
||||
toast(t('Successfully reset password.'), VariantType.SUCCESS),
|
||||
onError: () => toast(t('Failed to reset password'), VariantType.ERROR),
|
||||
onError: (error) =>
|
||||
toast(
|
||||
t(error.cause?.[0] || 'Failed to reset password'),
|
||||
VariantType.ERROR,
|
||||
),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user