##// END OF EJS Templates
Updating thread's last edit time when deleting a reply
Pavel Ryapolov -
r206:46eb401a default
parent child Browse files
Show More
@@ -66,6 +66,13 b' class PostManager(models.Manager):'
66 def delete_post(self, post):
66 def delete_post(self, post):
67 if post.replies.count() > 0:
67 if post.replies.count() > 0:
68 map(self.delete_post, post.replies.all())
68 map(self.delete_post, post.replies.all())
69
70 # Update thread's last edit time (used as cache key)
71 thread = post.thread
72 if thread:
73 thread.last_edit_time = timezone.now()
74 thread.save()
75
69 post.delete()
76 post.delete()
70
77
71 def delete_posts_by_ip(self, ip):
78 def delete_posts_by_ip(self, ip):
General Comments 0
You need to be logged in to leave comments. Login now