diff --git a/boards/views.py b/boards/views.py --- a/boards/views.py +++ b/boards/views.py @@ -418,7 +418,7 @@ def api_get_post(request, post_id): def api_get_threaddiff(request, thread_id, last_update_time): """Get posts that were changed or added since time""" - thread = get_object_or_404(Post, id=thread_id) + thread = get_object_or_404(Post, id=thread_id).thread_new filter_time = datetime.fromtimestamp(float(last_update_time) / 1000000, timezone.get_current_timezone()) @@ -428,10 +428,10 @@ def api_get_threaddiff(request, thread_i 'updated': [], 'last_update': None, } - added_posts = Post.objects.filter(thread=thread, + added_posts = Post.objects.filter(thread_new=thread, pub_time__gt=filter_time)\ .order_by('pub_time') - updated_posts = Post.objects.filter(thread=thread, + updated_posts = Post.objects.filter(thread_new=thread, pub_time__lte=filter_time, last_edit_time__gt=filter_time) for post in added_posts: