Email validation fails with Fault: 'ValidatedEmail' object has no attribute 'normalized'

I installed tryton on a Debian stable using the bookworm-7.0 m9s.biz sources. When entering an email address the following error is shown:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 109, in dispatch_request
    return endpoint(request, **request.view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/protocols/dispatcher.py", line 43, in rpc
    return methods.get(request.rpc_method, _dispatch)(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/wsgi.py", line 75, in wrapper
    return func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/protocols/wrappers.py", line 200, in wrapper
    return func(request, pool, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/protocols/dispatcher.py", line 201, in _dispatch
    result = rpc.result(meth(inst, *c_args, **c_kwargs))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/model/modelview.py", line 51, in wrapper
    result = func(self, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/model/fields/field.py", line 124, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/modules/party/contact_mechanism.py", line 236, in on_change_value
    return self._change_value(self.value, self.type)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/model/fields/field.py", line 124, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/modules/party/contact_mechanism.py", line 224, in _change_value
    self.value = self.format_value(value=value, type_=type_)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/model/fields/field.py", line 124, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/modules/party/contact_mechanism.py", line 204, in format_value
    value = normalize_email(value)
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/trytond/tools/email_.py", line 57, in normalize_email
    return emailinfo.normalized
           ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ValidatedEmail' object has no attribute 'normalized'

Fault: 'ValidatedEmail' object has no attribute 'normalized'

Therefor I cannot save the party, due to:

The values of "Contact Mechanisms" are not valid.

The package python3-email-validator is installed version 1.3.0-1. Why is it happening and how can I fix this?

version: 7.0.24-1~12bookworm+1

Your package python3-email-validator is too old. It should be at least 2.x

Thanks for the quick reply. I’ll try to install the version from Debian testing then (not recommended, though). Shouldn’t there be a check somewhere? The tryton suite is bookworm-7.0 and bookworm ships with version 1.3.0-1.

It is in the setup.py but it is the job of the packagers to implement them in their packages.

I installed 2.2.0-1 from trixie and it seems to work now. No error and the contact info can be saved. Thanks for the quick replies.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.