]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/user.py
convertd comments to nodes
[osqa.git] / forum / models / user.py
index 536663143a8851bd5f716c0d7701558a7f8d8cb1..ab5941435b12ed06580972b2864be96334f8f01a 100644 (file)
@@ -240,12 +240,14 @@ class Activity(GenericContent):
     @property\r
     def node(self):\r
         if self.activity_type in (const.TYPE_ACTIVITY_ANSWER, const.TYPE_ACTIVITY_ASK_QUESTION,\r
-                const.TYPE_ACTIVITY_MARK_ANSWER, const.TYPE_ACTIVITY_UPDATE_QUESTION):\r
+                const.TYPE_ACTIVITY_MARK_ANSWER):\r
             return self.content_object\r
 \r
-        if self.activity_type in (const.TYPE_ACTIVITY_COMMENT_QUESTION,\r
-                const.TYPE_ACTIVITY_COMMENT_ANSWER, const.TYPE_ACTIVITY_UPDATE_ANSWER):\r
-            return self.content_object.node.leaf\r
+        if self.activity_type in (const.TYPE_ACTIVITY_COMMENT_QUESTION, const.TYPE_ACTIVITY_COMMENT_ANSWER):\r
+            return self.content_object.parent.leaf\r
+\r
+        if self.activity_type in (const.TYPE_ACTIVITY_UPDATE_ANSWER, const.TYPE_ACTIVITY_UPDATE_QUESTION):\r
+            return self.content_object.node.leaf            \r
             \r
         raise NotImplementedError()\r
 \r