Ejemplo n.º 1
0
    def save(self, *args, **kwargs):
        super(Revision, self).save(*args, **kwargs)

        # When a revision is approved, re-cache the document's html content
        if self.is_approved and (
                not self.document.current_revision or
                self.document.current_revision.id < self.id):
            self.document.html = wiki_to_html(self.content, wiki_hooks=True)
            self.document.current_revision = self
            self.document.save()
Ejemplo n.º 2
0
 def content_parsed(self):
     return wiki_to_html(self.content)