diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index 567b0aea8..d57a2c5ab 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -141,7 +141,7 @@ class Annotation(models.Model): self.sortvalue = None #no clip or update clip - if self.layer in settings.CONFIG['clipLayers']: + if self.layer in settings.CONFIG.get('clipLayers', []): if not self.clip or self.start != self.clip.start or self.end != self.clip.end: self.clip, created = Clip.get_or_create(self.item, self.start, self.end) elif self.clip: diff --git a/pandora/clip/managers.py b/pandora/clip/managers.py index a4e95e21d..21a06c8b4 100644 --- a/pandora/clip/managers.py +++ b/pandora/clip/managers.py @@ -37,7 +37,7 @@ def parseCondition(condition, user): op = condition.get('operator') if not op: op = '' - if k in settings.CONFIG['clipLayers']: + if k in settings.CONFIG.get('clipLayers', []): return parseCondition({'key': 'annotations__findvalue', 'value': v, 'operator': op}, user) \ diff --git a/pandora/clip/models.py b/pandora/clip/models.py index 74c1c7a79..f8f0bc391 100644 --- a/pandora/clip/models.py +++ b/pandora/clip/models.py @@ -39,7 +39,7 @@ class MetaClip: if self.id: sortvalue = '' if self.id: - for l in settings.CONFIG['clipLayers']: + for l in settings.CONFIG.get('clipLayers', []): sortvalue += ''.join(filter(lambda s: s, [a.sortvalue for a in self.annotations.filter(layer=l).order_by('sortvalue')]))