|
|
@@ -523,8 +523,6 @@ def comment_submit_api(request):
|
523
|
523
|
photo_id = request.POST.get('photo_id', '')
|
524
|
524
|
comment = request.POST.get('comment', '')
|
525
|
525
|
|
526
|
|
- current_id = int(request.POST.get('current_id', -1))
|
527
|
|
-
|
528
|
526
|
try:
|
529
|
527
|
group = GroupInfo.objects.get(group_id=group_id)
|
530
|
528
|
except GroupInfo.DoesNotExist:
|
|
|
@@ -560,15 +558,12 @@ def comment_submit_api(request):
|
560
|
558
|
|
561
|
559
|
photo_comments = PhotoCommentInfo.objects.filter(
|
562
|
560
|
photo_id=photo_id,
|
563
|
|
- pk__gt=current_id
|
564
|
561
|
)
|
565
|
|
- latest_comment = photo_comments.last()
|
566
|
562
|
|
567
|
563
|
return JsonResponse({
|
568
|
564
|
'status': 200,
|
569
|
565
|
'message': u'评论成功',
|
570
|
566
|
'data': {
|
571
|
|
- 'current_id': latest_comment and latest_comment.pk or current_id,
|
572
|
567
|
'comments': [comment.comment_info for comment in photo_comments],
|
573
|
568
|
}
|
574
|
569
|
})
|