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

@ -191,7 +191,7 @@ class Edit(models.Model):
self.rightslevel = int(data['rightslevel'])
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])
if 'position' in data: