From 488b22889733d8c3b4ac4f8c7c73c72379e64132 Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Sat, 7 Oct 2017 04:17:03 +0000 Subject: Remove dict_list_key check This doesn't make any sense. If the dict list key isn't defined it falls through to the loop which would iterate the keys of a dict and not the dicts in a list which will likely fail anyhow. --- pandora/models/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandora/models/__init__.py b/pandora/models/__init__.py index 4f93dfc..d4e3b87 100644 --- a/pandora/models/__init__.py +++ b/pandora/models/__init__.py @@ -149,10 +149,7 @@ class PandoraDictListModel(PandoraModel, dict): self = cls(api_client) PandoraModel.populate_fields(api_client, self, data) - if self.__dict_list_key__: - data = data[self.__dict_list_key__] - - for item in data: + for item in data[self.__dict_list_key__]: key = item[self.__dict_key__] self[key] = [] -- cgit v1.2.3