polkascan / substrate-interface-api

Substrate Interface API Application
https://documenter.getpostman.com/view/9969999/SWT5iLXH?version=latest
GNU General Public License v3.0
4 stars 13 forks source link

AttributeError: 'list' object has no attribute 'get' #13

Open jadechip opened 3 years ago

jadechip commented 3 years ago

RPC for sending transactions results in the following error. It appears it tries to access a property that does not exists: here

[2021-05-01 21:34:58 +0000] [10] [ERROR] Error handling request /casa/nodes/thumbprints
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 135, in handle
    self.handle_request(listener, req, client, addr)
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/usr/local/lib/python3.7/site-packages/falcon/api.py", line 269, in __call__
    responder(req, resp, **params)
  File "/home/substrate-api/app/app/resources/jsonrpc.py", line 128, in on_post
    self.substrate.request_id = req.media.get('id')
AttributeError: 'list' object has no attribute 'get'
AliHaider20 commented 3 years ago

As per what I see you're trying to get the value of the id key. But the req. media is a list so if you've to access the index of id it should be req.media.index("id").