|
@@ -100,8 +100,7 @@ def story_index(request):
|
|
|
@login_required
|
|
@login_required
|
|
|
def story_details(request, story_id):
|
|
def story_details(request, story_id):
|
|
|
story = get_object_or_404(Story, id=story_id)
|
|
story = get_object_or_404(Story, id=story_id)
|
|
|
- comment_form = CommentForm()
|
|
|
|
|
- return render(request, 'story_details.html', {'story': story, 'comment_form': comment_form})
|
|
|
|
|
|
|
+ return render(request, 'story_details.html', {'story': story, 'comment_form': CommentForm()})
|
|
|
|
|
|
|
|
@login_required
|
|
@login_required
|
|
|
def story_create(request, epic_id=None):
|
|
def story_create(request, epic_id=None):
|
|
@@ -163,8 +162,7 @@ def story_reopen(request, story_id):
|
|
|
@login_required
|
|
@login_required
|
|
|
def epic_details(request, epic_id):
|
|
def epic_details(request, epic_id):
|
|
|
epic = get_object_or_404(Epic, id=epic_id)
|
|
epic = get_object_or_404(Epic, id=epic_id)
|
|
|
- comment_form = CommentForm()
|
|
|
|
|
- return render(request, 'epic_details.html', {'epic': epic, 'comment_form': comment_form})
|
|
|
|
|
|
|
+ return render(request, 'epic_details.html', {'epic': epic, 'comment_form': CommentForm()})
|
|
|
|
|
|
|
|
@login_required
|
|
@login_required
|
|
|
def epic_create(request):
|
|
def epic_create(request):
|
|
@@ -255,27 +253,11 @@ def comment_post(request, obj_uuid):
|
|
|
comment.save()
|
|
comment.save()
|
|
|
return redirect(request.META['HTTP_REFERER'])
|
|
return redirect(request.META['HTTP_REFERER'])
|
|
|
|
|
|
|
|
-# @login_required
|
|
|
|
|
-# def comment_post(request, obj_uuid):
|
|
|
|
|
-# data = json.loads(request.body.decode('utf-8'))
|
|
|
|
|
-# comment = Comment()
|
|
|
|
|
-# comment.obj_uuid = obj_uuid
|
|
|
|
|
-# comment.author = get_object_or_404(User, username=request.user)
|
|
|
|
|
-# comment.content = data["content"]
|
|
|
|
|
-# comment.save()
|
|
|
|
|
-# return HttpResponse(comment.to_json(),content_type="application/json")
|
|
|
|
|
-#
|
|
|
|
|
-# def comment_edit(request, comment_id):
|
|
|
|
|
-# data = json.loads(request.body.decode('utf-8'))
|
|
|
|
|
-# comment = get_object_or_404(Comment, id=comment_id)
|
|
|
|
|
-# comment.content= data["content"]
|
|
|
|
|
-# comment.save()
|
|
|
|
|
-# return HttpResponse(comment.to_json(),content_type="application/json")
|
|
|
|
|
-#
|
|
|
|
|
-# def comment_del(_, comment_id):
|
|
|
|
|
-# comment = get_object_or_404(Comment, id=comment_id)
|
|
|
|
|
-# comment.delete()
|
|
|
|
|
-# return HttpResponse("{}",content_type="application/json")
|
|
|
|
|
|
|
+@login_required
|
|
|
|
|
+def comment_del(request, comment_id):
|
|
|
|
|
+ comment = get_object_or_404(Comment, id=comment_id)
|
|
|
|
|
+ comment.delete()
|
|
|
|
|
+ return redirect(request.META['HTTP_REFERER'])
|
|
|
|
|
|
|
|
@login_required
|
|
@login_required
|
|
|
def search(request):
|
|
def search(request):
|