diff options
author | Dan McGee <dan@archlinux.org> | 2012-10-31 00:56:52 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-10-31 00:58:21 -0500 |
commit | 4122e97f7aa5ebb919c2afc88a3e548a2ab1e2aa (patch) | |
tree | 1d853cdcc373f767e398c2509d2571a19e229a8a /news/models.py | |
parent | ce5b0b2c5c10a3c840fd8aaa696ec2b8f403dc5b (diff) |
Store 'safe_mode' attribute on news model
This lets us identify old news items that need to allow HTML through the
markdown parser. For all new news items, we will disallow raw HTML.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'news/models.py')
-rw-r--r-- | news/models.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/news/models.py b/news/models.py index 55d36318..42adc199 100644 --- a/news/models.py +++ b/news/models.py @@ -16,13 +16,14 @@ class News(models.Model): title = models.CharField(max_length=255) guid = models.CharField(max_length=255, editable=False) content = models.TextField() + safe_mode = models.BooleanField(default=True, editable=False) def get_absolute_url(self): return '/news/%s/' % self.slug def html(self): return mark_safe(markdown.markdown( - self.content, safe_mode=False, enable_attributes=False)) + self.content, safe_mode=self.safe_mode, enable_attributes=False)) def __unicode__(self): return self.title |