Anyone know why this is returning 'TypeError: 'NoneType' object is not subscriptable'?
import requests, json
url2 = "https://xxx.xxxxxx.xx/xxx/xx/xxxxxx"
querystring = {"order_direction":"desc","offset":"0","limit":"5000", "owner": "xxxxxxxxxxxxxxxxxxxxxxxx"}
headers = {
"Accept": "application/json",
}
r = requests.get(url2, params=querystring, headers=headers).json()
for asset in r['assets']:
if asset != None:
print(asset['creator']['user']['username'])