##// END OF EJS Templates
Fixed resetting cache when the thread is bumped
neko259 -
r1240:92ddbd4a default
parent child Browse files
Show More
@@ -83,15 +83,13 b' class PostManager(models.Manager):'
83 opening_posts = []
83 opening_posts = []
84
84
85 posting_time = timezone.now()
85 posting_time = timezone.now()
86 new_thread = False
86 if not thread:
87 if not thread:
87 thread = boards.models.thread.Thread.objects.create(
88 thread = boards.models.thread.Thread.objects.create(
88 bump_time=posting_time, last_edit_time=posting_time)
89 bump_time=posting_time, last_edit_time=posting_time)
89 list(map(thread.tags.add, tags))
90 list(map(thread.tags.add, tags))
90 boards.models.thread.Thread.objects.process_oldest_threads()
91 boards.models.thread.Thread.objects.process_oldest_threads()
91 else:
92 new_thread = True
92 thread.last_edit_time = posting_time
93 thread.bump()
94 thread.save()
95
93
96 pre_text = Parser().preparse(text)
94 pre_text = Parser().preparse(text)
97
95
@@ -115,6 +113,12 b' class PostManager(models.Manager):'
115 post.connect_threads(opening_posts)
113 post.connect_threads(opening_posts)
116 post.connect_notifications()
114 post.connect_notifications()
117
115
116 # Thread needs to be bumped only when the post is already created
117 if not new_thread:
118 thread.last_edit_time = posting_time
119 thread.bump()
120 thread.save()
121
118 return post
122 return post
119
123
120 def delete_posts_by_ip(self, ip):
124 def delete_posts_by_ip(self, ip):
@@ -3,7 +3,6 b' This module contains helper functions an'
3 """
3 """
4 import time
4 import time
5 import hmac
5 import hmac
6 import functools
7
6
8 from django.core.cache import cache
7 from django.core.cache import cache
9 from django.db.models import Model
8 from django.db.models import Model
General Comments 0
You need to be logged in to leave comments. Login now