-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Description
Hi There,
When calling list_files on an ImageKit object, it throws a "created_by" error on any new image uploaded to ImageKit in the Media Library. This may have to do with a new attribute called "created" that is appearing in the web interface. To reproduce the error:
imagekit_obj = ImageKit(
private_key=IMAGEKIT_PRIVATE_KEY,
public_key=IMAGEKIT_PUBLIC_KEY,
url_endpoint=IMAGEKIT_URL_ENDPOINT,
)
options = ListAndSearchFileRequestOptions(
type="file", sort="ASC_CREATED", file_type="all"
)
results = imagekit_obj.list_files(options=options)
This throws TypeError: FileResult.__init__() got an unexpected keyword argument 'created_by.
Seems to be related to utils/utils.py
def convert_to_list_response_object(
resp: Response, response_object, list_response_object
):
response_list = []
for item in resp.json():
res_new = loads(dumps(camel_dict_to_snake_dict(item)))
u = response_object(**res_new)
response_list.append(u)
u = list_response_object(response_list)
u.response_metadata = ResponseMetadata(resp.json(), resp.status_code, resp.headers)
return u
Metadata
Metadata
Assignees
Labels
No labels