Ticket #8968: fix-next-redirect.diff
File fix-next-redirect.diff, 2.5 KB (added by , 16 years ago) |
---|
-
django/contrib/comments/views/moderation.
old new 9 9 from django.contrib.comments import signals 10 10 11 11 #@login_required 12 def flag(request, comment_id , next=None):12 def flag(request, comment_id): 13 13 """ 14 14 Flags a comment. Confirmation on GET, action on POST. 15 15 … … 34 34 created = created, 35 35 request = request, 36 36 ) 37 return next_redirect(request.POST.copy(), next, flag_done, c=comment.pk)37 return next_redirect(request.POST.copy(), None, flag_done, c=comment.pk) 38 38 39 39 # Render a form on GET 40 40 else: 41 next = request.GET.get('next') 41 42 return render_to_response('comments/flag.html', 42 43 {'comment': comment, "next": next}, 43 44 template.RequestContext(request) … … 45 46 flag = login_required(flag) 46 47 47 48 #@permission_required("comments.delete_comment") 48 def delete(request, comment_id , next=None):49 def delete(request, comment_id): 49 50 """ 50 51 Deletes a comment. Confirmation on GET, action on POST. Requires the "can 51 52 moderate comments" permission. … … 74 75 created = created, 75 76 request = request, 76 77 ) 77 return next_redirect(request.POST.copy(), next, delete_done, c=comment.pk)78 return next_redirect(request.POST.copy(), None, delete_done, c=comment.pk) 78 79 79 80 # Render a form on GET 80 81 else: 82 next = request.GET.get('next') 81 83 return render_to_response('comments/delete.html', 82 84 {'comment': comment, "next": next}, 83 85 template.RequestContext(request) … … 85 87 delete = permission_required("comments.can_moderate")(delete) 86 88 87 89 #@permission_required("comments.can_moderate") 88 def approve(request, comment_id , next=None):90 def approve(request, comment_id): 89 91 """ 90 92 Approve a comment (that is, mark it as public and non-removed). Confirmation 91 93 on GET, action on POST. Requires the "can moderate comments" permission. … … 117 119 created = created, 118 120 request = request, 119 121 ) 120 return next_redirect(request.POST.copy(), next, approve_done, c=comment.pk)122 return next_redirect(request.POST.copy(), None, approve_done, c=comment.pk) 121 123 122 124 # Render a form on GET 123 125 else: 126 next = request.GET.get('next') 124 127 return render_to_response('comments/approve.html', 125 128 {'comment': comment, "next": next}, 126 129 template.RequestContext(request)