From: jordan Date: Wed, 22 Dec 2010 20:43:45 +0000 (+0000) Subject: Patch for OSQA-499 from Jira, after activation of each revision we markdown the conte... X-Git-Tag: live~513 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/9a753927ed2c86552f8f58dd464f28025774a200?ds=sidebyside Patch for OSQA-499 from Jira, after activation of each revision we markdown the content and save it markdowned. The performance is increased, as the as_markdown method is not triggered every time we execute the script. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@621 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/models/node.py b/forum/models/node.py index 69c6396..042aad8 100644 --- a/forum/models/node.py +++ b/forum/models/node.py @@ -21,7 +21,7 @@ class NodeContent(models.Model): @property def html(self): - return self.as_markdown() + return self.body @classmethod def _as_markdown(cls, content, *extensions): @@ -334,10 +334,10 @@ class Node(BaseModel, NodeContent): self.activate_revision(user, revision) return revision - def activate_revision(self, user, revision): + def activate_revision(self, user, revision, *extensions): self.title = revision.title self.tagnames = revision.tagnames - self.body = revision.body + self.body = self._as_markdown(revision.body, *extensions) self.active_revision = revision self.update_last_activity(user)