diff options
-rw-r--r-- | askbot/models/__init__.py | 5 | ||||
-rw-r--r-- | askbot/models/reply_by_email.py | 7 | ||||
-rw-r--r-- | askbot/views/users.py | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py index 2526c4b7..30df6366 100644 --- a/askbot/models/__init__.py +++ b/askbot/models/__init__.py @@ -1252,6 +1252,11 @@ def user_delete_comment( timestamp = None ): self.assert_can_delete_comment(comment = comment) + #todo: we want to do this + #comment.deleted = True + #comment.deleted_by = self + #comment.deleted_at = timestamp + #comment.save() comment.delete() comment.thread.invalidate_cached_data() diff --git a/askbot/models/reply_by_email.py b/askbot/models/reply_by_email.py index 8cb88241..0bf46a14 100644 --- a/askbot/models/reply_by_email.py +++ b/askbot/models/reply_by_email.py @@ -113,7 +113,12 @@ class ReplyAddress(models.Model): revision_comment = revision_comment, by_email = True ) - self.response_post.thread.invalidate_cached_data() + #todo: why do we have these branches? + if self.response_post: + thread = self.response_post.thread + else: + thread = self.post.thread + thread.invalidate_cached_data() def create_reply(self, body_text): """creates a reply to the post which was emailed diff --git a/askbot/views/users.py b/askbot/views/users.py index 065ca578..4d425b60 100644 --- a/askbot/views/users.py +++ b/askbot/views/users.py @@ -662,6 +662,10 @@ def user_responses(request, user, context): response_list = list() for memo in memo_set: #a monster query chain below + if memo.activity is None: + #todo: this is a temporary plug, due to + #poor handling of comment deletion - see User.delete_comment() + continue response = { 'id': memo.id, 'timestamp': memo.activity.active_at, |