X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/4496d7188a21ea6706e3b8a9ca5742c64767c134..133a8f939cdfa69dd6a7caeafed158aa38d20092:/forum/models/user.py diff --git a/forum/models/user.py b/forum/models/user.py index 5366631..ab59414 100644 --- a/forum/models/user.py +++ b/forum/models/user.py @@ -240,12 +240,14 @@ class Activity(GenericContent): @property def node(self): if self.activity_type in (const.TYPE_ACTIVITY_ANSWER, const.TYPE_ACTIVITY_ASK_QUESTION, - const.TYPE_ACTIVITY_MARK_ANSWER, const.TYPE_ACTIVITY_UPDATE_QUESTION): + const.TYPE_ACTIVITY_MARK_ANSWER): return self.content_object - if self.activity_type in (const.TYPE_ACTIVITY_COMMENT_QUESTION, - const.TYPE_ACTIVITY_COMMENT_ANSWER, const.TYPE_ACTIVITY_UPDATE_ANSWER): - return self.content_object.node.leaf + if self.activity_type in (const.TYPE_ACTIVITY_COMMENT_QUESTION, const.TYPE_ACTIVITY_COMMENT_ANSWER): + return self.content_object.parent.leaf + + if self.activity_type in (const.TYPE_ACTIVITY_UPDATE_ANSWER, const.TYPE_ACTIVITY_UPDATE_QUESTION): + return self.content_object.node.leaf raise NotImplementedError()