##// END OF EJS Templates
Fixed issue in rendering post without having a request
neko259 -
r1117:899891b1 default
parent child Browse files
Show More
@@ -293,7 +293,7 b' class Post(models.Model, Viewable):'
293 293 """
294 294
295 295 if format_type == DIFF_TYPE_HTML:
296 if PARAMETER_TRUNCATED in request.GET:
296 if request is not None and PARAMETER_TRUNCATED in request.GET:
297 297 truncated = True
298 298 reply_link = False
299 299 else:
@@ -1,11 +1,9 b''
1 from datetime import datetime
2 1 import json
3 2 import logging
3
4 4 from django.db import transaction
5 5 from django.http import HttpResponse
6 from django.shortcuts import get_object_or_404, render
7 from django.template import RequestContext
8 from django.utils import timezone
6 from django.shortcuts import get_object_or_404
9 7 from django.core import serializers
10 8
11 9 from boards.forms import PostForm, PlainErrorList
@@ -14,6 +12,7 b' from boards.utils import datetime_to_epo'
14 12 from boards.views.thread import ThreadView
15 13 from boards.models.user import Notification
16 14
15
17 16 __author__ = 'neko259'
18 17
19 18 PARAMETER_TRUNCATED = 'truncated'
@@ -207,7 +206,7 b' def api_get_notifications(request, usern'
207 206 last_id = int(last_notification_id_str) if last_notification_id_str is not None else None
208 207
209 208 posts = Notification.objects.get_notification_posts(username=username,
210 last=last_id)
209 last=last_id)
211 210
212 211 json_post_list = []
213 212 for post in posts:
@@ -215,7 +214,6 b' def api_get_notifications(request, usern'
215 214 return HttpResponse(content=json.dumps(json_post_list))
216 215
217 216
218
219 217 def api_get_post(request, post_id):
220 218 """
221 219 Gets the JSON of a post. This can be
General Comments 0
You need to be logged in to leave comments. Login now