##// END OF EJS Templates
Do not connect already connected replies
neko259 -
r1542:5966db37 default
parent child Browse files
Show More
@@ -347,10 +347,12 b' def connect_replies(instance, **kwargs):'
347 try:
347 try:
348 referenced_post = Post.objects.get(id=post_id)
348 referenced_post = Post.objects.get(id=post_id)
349
349
350 referenced_post.referenced_posts.add(instance)
350 # Connect only to posts that are not connected to already
351 referenced_post.last_edit_time = instance.pub_time
351 if not referenced_post.referenced_posts.filter(id=instance.id).exists():
352 referenced_post.build_refmap()
352 referenced_post.referenced_posts.add(instance)
353 referenced_post.save(update_fields=['refmap', 'last_edit_time'])
353 referenced_post.last_edit_time = instance.pub_time
354 referenced_post.build_refmap()
355 referenced_post.save(update_fields=['refmap', 'last_edit_time'])
354 except ObjectDoesNotExist:
356 except ObjectDoesNotExist:
355 pass
357 pass
356
358
General Comments 0
You need to be logged in to leave comments. Login now