Skip to content

Commit

Permalink
saved
Browse files Browse the repository at this point in the history
  • Loading branch information
em230418 committed Oct 7, 2024
1 parent 8bd450f commit afefb8d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions website_event_attendee_fields/controllers/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: E501
import re

from odoo import http
Expand Down
9 changes: 5 additions & 4 deletions website_event_attendee_fields/models/event_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def create(self, vals):

if res.attendee_partner_id:
# be sure, that name and phone in registration are ones from Attendee,
# because built-in modules take them from Partner (buyer) if ones are no presented
# because built-in modules take them from Partner (buyer)
# if ones are no presented
res.name = res.attendee_partner_id.name
res.phone = res.attendee_partner_id.phone

Expand Down Expand Up @@ -73,7 +74,7 @@ def create(self, vals):
res.message_post(
author_id=self.env.ref("base.partner_root").id,
body=_(
"Attendee partner record are not updated for security reasons:<br/> %s "
"Attendee partner record are not updated for security reasons:<br/> %s " # noqa: E501
)
% partner_vals_to_ignore,
)
Expand All @@ -85,7 +86,7 @@ def _prepare_partner(self, vals):
event = self.env["event.event"].browse(vals["event_id"])
if not event.attendee_field_ids:
# attendee_field_ids is not configure
# May happen in tests of other modules, which don't suppose that this module is installed.
# May happen in tests of other modules, which don't suppose that this module is installed. # noqa: E501
# Just return super values.
return super(EventRegistration, self)._prepare_partner(vals)

Expand All @@ -100,7 +101,7 @@ def _prepare_partner(self, vals):
value = vals.get(field.field_name)
if value:
# Don't pass empty value, because it removes previous value.
# E.g. when partner with email is specified and known fields are not filled at the form
# E.g. when partner with email is specified and known fields are not filled at the form # noqa: E501
res[fn] = value

if fn not in self._fields:
Expand Down
2 changes: 1 addition & 1 deletion website_event_attendee_fields/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _cart_update(
and order_line.event_id
and "event_ticket_id" not in self.env.context
):
# _cart_update can be called in registration_confirm and "event_ticket_id in context" is a way to exclude that case
# _cart_update can be called in registration_confirm and "event_ticket_id in context" is a way to exclude that case # noqa: E501
quantity = 0
# compute new quantity
if set_qty:
Expand Down
2 changes: 1 addition & 1 deletion website_event_attendee_fields/tests/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_base(self):
att_email = "[email protected]"
att_function = "JOB2"

# data in tours are saved (but not commited!) via different cursor. So, we have to use that one
# data in tours are saved (but not commited!) via different cursor. So, we have to use that one # noqa: E501
test_env = api.Environment(self.registry.test_cr, self.uid, {})

partner = test_env["res.partner"].search([("email", "=ilike", att_email)])
Expand Down

0 comments on commit afefb8d

Please sign in to comment.