Skip to content

Letter Sending succeeding but failing to build return objects #12

@ryleysevier

Description

@ryleysevier

I might be doing something wrong here but just in case:

Calling send_letter and getting 'str' object has no attribute 'keys' but having successful letters go through

return util.build_objects(letter, response['body'])

response['body'] is a flat dict and I think build_objects is looking for a list of dicts to convert. That would match up with the attachments and sms endpoints which return lists

Traceback

send_result = inv_invoice.send_letter(idempotency_key=idempotency_key)
  File "\.venv\lib\site-packages\invoiced\objects.py", line 285, in send_letter
    return util.build_objects(letter, response['body'])
  File "\.venv\lib\site-packages\invoiced\util.py", line 5, in build_objects
    return list(map(lambda obj: convert_to_object(_class, obj), objects))
  File "\.venv\lib\site-packages\invoiced\util.py", line 5, in <lambda>
    return list(map(lambda obj: convert_to_object(_class, obj), objects))
  File "\.venv\lib\site-packages\invoiced\util.py", line 14, in convert_to_object
    if 'object' in values.keys():
AttributeError: 'str' object has no attribute 'keys'

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