X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/133a8f939cdfa69dd6a7caeafed158aa38d20092..32c46c35fc9dbf3305dc774b144ff5af5176c9de:/forum/models/comment.py?ds=sidebyside diff --git a/forum/models/comment.py b/forum/models/comment.py index 071126e..a2e7425 100644 --- a/forum/models/comment.py +++ b/forum/models/comment.py @@ -15,6 +15,10 @@ class Comment(Node): def comment(self): return self.body + @property + def headline(self): + return self.absolute_parent.headline + @property def content_object(self): return self.parent.leaf @@ -28,7 +32,7 @@ class Comment(Node): try: ping_google() except Exception: - logging.debug('problem pinging google did you register you sitemap with google?') + logging.debug('problem pinging google did you register your sitemap with google?') def mark_deleted(self, user): if super(Comment, self).mark_deleted(user): @@ -39,12 +43,15 @@ class Comment(Node): self._update_parent_comment_count(1) def is_reply_to(self, user): - inreply = re.search('@\w+', self.comment) + inreply = re.search('@\w+', self.body) if inreply is not None: return user.username.startswith(inreply.group(0)) return False + def get_absolute_url(self): + return self.absolute_parent.get_absolute_url() + "#%d" % self.id + def __unicode__(self): return self.body