Commit 812b89e
committed
fix: allow registration with unverified email when verification is not mandatory
Previously, the registration process incorrectly blocked users from registering with an existing but unverified email, even when email verification was not mandatory. This caused a unique constraint error when saving the user.
This fix updates the `validate_email` method in `CustomRegisterSerializer` to:
- Allow registration if the email exists but is unverified, **only if verification is not mandatory**.
- Prevent duplicate registrations if the email is already verified.
- Improve error messages for better clarity.
This ensures smoother registration flows while maintaining email uniqueness where required.1 parent 554d7b6 commit 812b89e
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| |||
0 commit comments