check data is a dict

This commit is contained in:
j 2016-02-19 18:46:53 +05:30
commit d241b90b63
4 changed files with 6 additions and 4 deletions

View file

@ -116,7 +116,7 @@ class List(models.Model):
for key in data:
if key == 'query' and not data['query']:
setattr(self, key, {"static":True})
elif key == 'query':
elif key == 'query' and isinstance(data[key], dict):
setattr(self, key, data[key])
elif key == 'type':
if data[key] == 'static':