From 9d3c50fcec2b27001b814369c22a4ece3764e245 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 21 Apr 2015 15:34:37 +0530 Subject: [PATCH] ignore undefined entity data --- pandora/entity/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora/entity/models.py b/pandora/entity/models.py index e126e8f28..9815e82f7 100644 --- a/pandora/entity/models.py +++ b/pandora/entity/models.py @@ -180,9 +180,11 @@ class Entity(models.Model): else: Find.objects.filter(entity=self, key=key).delete() + entity = get_by_id(settings.CONFIG['entities'], self.type) + if not entity: + return with transaction.commit_on_success(): ids = ['name'] - entity = get_by_id(settings.CONFIG['entities'], self.type) for key in entity['keys']: value = self.data.get(key['id']) if isinstance(value, list):