diff --git a/website_event_attendee_fields/controllers/main.py b/website_event_attendee_fields/controllers/main.py index 2397206..e29a997 100644 --- a/website_event_attendee_fields/controllers/main.py +++ b/website_event_attendee_fields/controllers/main.py @@ -1,8 +1,9 @@ # ruff: noqa: E501 import re -from odoo import http +from odoo import _, http from odoo.http import request +from odoo.tools.mail import email_normalize from odoo.addons.website_event.controllers.main import WebsiteEventController @@ -56,6 +57,10 @@ def _process_attendees_form(self, event, form_details): ) def check_email(self, event_id, email): Partners = request.env["res.partner"].sudo() + email = email_normalize(email, True) + + if not email: + return {"email_not_allowed": _("Invalid email")} current_user = request.env.user if email == current_user.email: