##// END OF EJS Templates
Little refactoring to the post creation
neko259 -
r1230:f2b423d9 default
parent child Browse files
Show More
@@ -87,9 +87,11 b' class PostManager(models.Manager):'
87 thread = boards.models.thread.Thread.objects.create(
87 thread = boards.models.thread.Thread.objects.create(
88 bump_time=posting_time, last_edit_time=posting_time)
88 bump_time=posting_time, last_edit_time=posting_time)
89 list(map(thread.tags.add, tags))
89 list(map(thread.tags.add, tags))
90 new_thread = True
90 boards.models.thread.Thread.objects.process_oldest_threads()
91 else:
91 else:
92 new_thread = False
92 thread.last_edit_time = posting_time
93 thread.bump()
94 thread.save()
93
95
94 pre_text = Parser().preparse(text)
96 pre_text = Parser().preparse(text)
95
97
@@ -108,13 +110,6 b' class PostManager(models.Manager):'
108 if image:
110 if image:
109 post.images.add(PostImage.objects.create_with_hash(image))
111 post.images.add(PostImage.objects.create_with_hash(image))
110
112
111 if new_thread:
112 boards.models.thread.Thread.objects.process_oldest_threads()
113 else:
114 thread.last_edit_time = posting_time
115 thread.bump()
116 thread.save()
117
118 post.build_url()
113 post.build_url()
119 post.connect_replies()
114 post.connect_replies()
120 post.connect_threads(opening_posts)
115 post.connect_threads(opening_posts)
General Comments 0
You need to be logged in to leave comments. Login now