Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Letter Sending succeeding but failing to build return objects #12

Open
ryleysevier opened this issue Oct 31, 2024 · 0 comments
Open

Letter Sending succeeding but failing to build return objects #12

ryleysevier opened this issue Oct 31, 2024 · 0 comments

Comments

@ryleysevier
Copy link

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant