dont fail if clipLayers is missing

This commit is contained in:
j 2012-04-02 17:33:09 +02:00
commit 9da8c75f70
3 changed files with 3 additions and 3 deletions

View file

@ -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) \

View file

@ -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')]))