Skip to content

Fix bug that email notifier's value is not validated through APIs - #790

Merged
vincent-olivert-riera merged 2 commits into
line:masterfrom
hoangpn:bug_fix/email_validation_for_notifier_APIs
Sep 28, 2026
Merged

vincent-olivert-riera merged 2 commits into
line:masterfrom
hoangpn:bug_fix/email_validation_for_notifier_APIs

Conversation

@hoangpn

@hoangpn hoangpn commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

We fixed a bug that email notifier's value is not validated through APIs by adding two updates:

  • Add validation to the Sender model.
  • Convert DjangoValidationError into DRFValidationError at custom_exception_handler.

We overlooked validating the email notifier's value during creation or updates via APIs. To
fully resolve this issue, we have added validation at the model layer.

As a result, the existing similar validation in admin.py is removed.
Previously, when a DjangoValidationError occurred, DRF would return a generic 500 Server Error
response, which is not user-friendly. This kind of error should be shown in detail to user.
Therefore, we have updated the DRF custom_exception_handler to convert DjangoValidationError
into DRFValidationError. This change ensures that detailed messages are generated and returned
to the user.
@hoangpn
hoangpn force-pushed the bug_fix/email_validation_for_notifier_APIs branch from 0b5c4e6 to 23f0343 Compare September 28, 2026 06:30
@vincent-olivert-riera
vincent-olivert-riera merged commit c813525 into line:master Sep 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants