##// END OF EJS Templates
Fixed thread update
neko259 -
r772:f4d155db default
parent child Browse files
Show More
@@ -7,6 +7,7 b' from django.shortcuts import get_object_'
7 from django.template import RequestContext
7 from django.template import RequestContext
8 from django.utils import timezone
8 from django.utils import timezone
9 from django.core import serializers
9 from django.core import serializers
10 from django.template.loader import render_to_string
10
11
11 from boards.forms import PostForm, PlainErrorList
12 from boards.forms import PostForm, PlainErrorList
12 from boards.models import Post, Thread, Tag
13 from boards.models import Post, Thread, Tag
@@ -219,7 +220,14 b' def api_get_post(request, post_id):'
219 def _get_post_data(post_id, format_type=DIFF_TYPE_JSON, request=None,
220 def _get_post_data(post_id, format_type=DIFF_TYPE_JSON, request=None,
220 include_last_update=False):
221 include_last_update=False):
221 if format_type == DIFF_TYPE_HTML:
222 if format_type == DIFF_TYPE_HTML:
222 return get_post(request, post_id).content.strip()
223 post = get_object_or_404(Post, id=post_id)
224
225 context = RequestContext(request)
226 context['post'] = post
227 if PARAMETER_TRUNCATED in request.GET:
228 context[PARAMETER_TRUNCATED] = True
229
230 return render_to_string('boards/api_post.html', context)
223 elif format_type == DIFF_TYPE_JSON:
231 elif format_type == DIFF_TYPE_JSON:
224 post = get_object_or_404(Post, id=post_id)
232 post = get_object_or_404(Post, id=post_id)
225 post_json = {
233 post_json = {
General Comments 0
You need to be logged in to leave comments. Login now