Skip to content

AttributeError: enderecoERP instance has no attribute 'id' #140

@lcspereira

Description

@lcspereira

Hi,

I'm having this error when I try to query any CEPs. I ran update-correios-wsdl, but this error continues.
Here is the StackTrace:

Traceback (most recent call last):
File "/home/lucas/anaconda3/lib/python3.6/site-packages/zeep/xsd/valueobjects.py", line 138, in getattribute
return self.values[key]
KeyError: 'id'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/lucas/anaconda3/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/home/lucas/anaconda3/lib/python3.6/site-packages/django/core/handlers/base.py", line 128, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/lucas/anaconda3/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/run/media/lucas/COMMON/programas/python/labengsoft/mainapp/views.py", line 58, in enderecoByCepView
endereco = serializers.serialize ('json', [ Endereco.getEnderecoByCep(str(cep)) ])
File "/run/media/lucas/COMMON/programas/python/labengsoft/mainapp/models.py", line 186, in getEnderecoByCep
zip = cliente.find_zipcode(ZipCode(cep))
File "/home/lucas/anaconda3/lib/python3.6/site-packages/correios/client.py", line 153, in find_zipcode
return self.model_builder.build_zip_address(zip_address_data)
File "/home/lucas/anaconda3/lib/python3.6/site-packages/correios/models/builders.py", line 98, in build_zip_address
id=zip_address_data.id,
File "/home/lucas/anaconda3/lib/python3.6/site-packages/zeep/xsd/valueobjects.py", line 142, in getattribute
self.class.name, key))
AttributeError: enderecoERP instance has no attribute 'id'

Any advice?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions