# HG changeset patch # User neko259 # Date 2013-11-23 14:01:38 # Node ID 6dc0cb4710fb106d8f84d7862a0338fe8ec0da99 # Parent b2448061b6ddb6dc82d3768a0963ae2ae030b42a Fixed api diff method that was broken after post model split 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: