aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2017-10-07 04:17:03 +0000
committerMike Crute <mike@crute.us>2017-10-07 04:37:42 +0000
commit488b22889733d8c3b4ac4f8c7c73c72379e64132 (patch)
tree5a42a2388da55a924e70855bfc1f7349d90fa048
parent24281ca6994de79ce36a7d1805a5392590a1c22c (diff)
downloadpydora-488b22889733d8c3b4ac4f8c7c73c72379e64132.tar.bz2
pydora-488b22889733d8c3b4ac4f8c7c73c72379e64132.tar.xz
pydora-488b22889733d8c3b4ac4f8c7c73c72379e64132.zip
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.
-rw-r--r--pandora/models/__init__.py5
1 files changed, 1 insertions, 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):
149 self = cls(api_client) 149 self = cls(api_client)
150 PandoraModel.populate_fields(api_client, self, data) 150 PandoraModel.populate_fields(api_client, self, data)
151 151
152 if self.__dict_list_key__: 152 for item in data[self.__dict_list_key__]:
153 data = data[self.__dict_list_key__]
154
155 for item in data:
156 key = item[self.__dict_key__] 153 key = item[self.__dict_key__]
157 self[key] = [] 154 self[key] = []
158 155