Skip to content

Commit

Permalink
[admin] Handle missing template variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
glogiotatidis committed Feb 2, 2015
1 parent b798029 commit 16b449e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snippets/base/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def text(self, obj):
text_keys = (obj.template.variable_set
.filter(type=models.SnippetTemplateVariable.TEXT)
.values_list('name', flat=True))
return '\n'.join([data[key] for key in text_keys if data[key]])
return '\n'.join([data[key] for key in text_keys if data.get(key)])


class ClientMatchRuleAdmin(BaseModelAdmin):
Expand Down

0 comments on commit 16b449e

Please sign in to comment.