diff options
author | Mike Crute <mike@crute.us> | 2017-10-07 04:17:03 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2017-10-07 04:37:42 +0000 |
commit | 488b22889733d8c3b4ac4f8c7c73c72379e64132 (patch) | |
tree | 5a42a2388da55a924e70855bfc1f7349d90fa048 | |
parent | 24281ca6994de79ce36a7d1805a5392590a1c22c (diff) | |
download | pydora-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__.py | 5 |
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 | ||