Skip to content

Commit

Permalink
[FIX] website_event_attendee_fields: нормализуем почту перед проверко…
Browse files Browse the repository at this point in the history
…й о наличии регистрации
  • Loading branch information
em230418 committed Dec 26, 2024
1 parent 17e55f1 commit 1b37f2f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion website_event_attendee_fields/controllers/main.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 1b37f2f

Please sign in to comment.