]> git.openstreetmap.org Git - osqa.git/commitdiff
Fix error reported at http://meta.osqa.net/question/1661/error-creating-language...
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 7 May 2010 20:52:11 +0000 (20:52 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 7 May 2010 20:52:11 +0000 (20:52 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@163 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/actions/node.py

index d7f938313f2482cf98bba14bef862ef01066a69e..be386facd8d640aaba0eba19437450496c138f5b 100644 (file)
@@ -5,7 +5,7 @@ from forum.models import Comment, Question, Answer, NodeRevision
 \r
 class NodeEditAction(ActionProxy):\r
     def create_revision_data(self, initial=False, **data):\r
-        revision_data = dict(summary=data.get('summary', (initial and _('Initial revision' or ''))), body=data['text'])\r
+        revision_data = dict(summary=data.get('summary', (initial and _('Initial revision') or '')), body=data['text'])\r
 \r
         if data.get('title', None):\r
             revision_data['title'] = strip_tags(data['title'].strip())\r
@@ -16,6 +16,8 @@ class NodeEditAction(ActionProxy):
         return revision_data\r
 \r
 class AskAction(NodeEditAction):\r
+    verb = _("asked")\r
+\r
     def process_data(self, **data):\r
         question = Question(author=self.user, **self.create_revision_data(True, **data))\r
         question.save()\r
@@ -28,6 +30,8 @@ class AskAction(NodeEditAction):
         }\r
 \r
 class AnswerAction(NodeEditAction):\r
+    verb = _("answered")\r
+\r
     def process_data(self, **data):\r
         answer = Answer(author=self.user, parent=data['question'], **self.create_revision_data(True, **data))\r
         answer.save()\r
@@ -45,6 +49,8 @@ class AnswerAction(NodeEditAction):
         }\r
 \r
 class CommentAction(ActionProxy):\r
+    verb = _("commented")\r
+\r
     def process_data(self, text='', parent=None):\r
         comment = Comment(author=self.user, parent=parent, body=text)\r
         comment.save()\r
@@ -57,6 +63,8 @@ class CommentAction(ActionProxy):
         }\r
 \r
 class ReviseAction(NodeEditAction):\r
+    verb = _("edited")\r
+\r
     def process_data(self, **data):\r
         revision_data = self.create_revision_data(**data)\r
         revision = self.node.create_revision(self.user, action=self, **revision_data)\r
@@ -68,7 +76,12 @@ class ReviseAction(NodeEditAction):
             'post_desc': self.describe_node(viewer, self.node)\r
         }\r
 \r
+    def get_absolute_url(self):\r
+        return self.node.get_revisions_url()\r
+\r
 class RetagAction(ActionProxy):\r
+    verb = _("retagged")\r
+\r
     def process_data(self, tagnames=''):\r
         active = self.node.active_revision\r
         revision_data = dict(summary=_('Retag'), title=active.title, tagnames=strip_tags(tagnames.strip()), body=active.body)\r
@@ -80,7 +93,12 @@ class RetagAction(ActionProxy):
             'post_desc': self.describe_node(viewer, self.node)\r
         }\r
 \r
+    def get_absolute_url(self):\r
+        return self.node.get_revisions_url()\r
+\r
 class RollbackAction(ActionProxy):\r
+    verb = _("reverted")\r
+\r
     def process_data(self, activate=None):\r
         previous = self.node.active_revision\r
         self.node.activate_revision(self.user, activate, self)\r
@@ -96,7 +114,12 @@ class RollbackAction(ActionProxy):
             'final': revisions[1].revision, 'final_sum': revisions[1].summary,\r
         }\r
 \r
+    def get_absolute_url(self):\r
+        return self.node.get_revisions_url()\r
+\r
 class CloseAction(ActionProxy):\r
+    verb = _("closed")\r
+\r
     def process_action(self):\r
         self.node.extra_action = self\r
         self.node.marked = True\r