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

Do not convert dictionary to json #10

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

damascene
Copy link

The application is trying to covert a dictionary to json showing the following error: AttributeError: 'dict' object has no attribute 'json'

Traceback:

string indices must be integers, not 'str'
Traceback (most recent call last):
  File "/home/user/pytomicDEX_makerbot/makerbot.py", line 90, in <module>
    main()
  File "/home/user/pytomicDEX_makerbot/makerbot.py", line 49, in main
    status_print(tui.dex.status)
                 ^^^^^^^^^^^^^^
  File "/home/user/pytomicDEX_makerbot/models.py", line 163, in status
    successful_swaps_count, failed_swaps_count, delta = self.get_recent_swaps_info(
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/pytomicDEX_makerbot/models.py", line 200, in get_recent_swaps_info
    recent_swaps = self.get_recent_swaps()
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/pytomicDEX_makerbot/models.py", line 241, in get_recent_swaps
    return self.mm2_proxy({"method": "my_recent_swaps", "limit": limit})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/pytomicDEX_makerbot/models.py", line 80, in mm2_proxy
    resp = r.json()
           ^^^^^^
AttributeError: 'dict' object has no attribute 'json'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant