Ticket #8963: contrib-comments-requirepost.diff
File contrib-comments-requirepost.diff, 1.1 KB (added by , 16 years ago) |
---|
-
django/contrib/comments/views/comments.py
7 7 from django.template import RequestContext 8 8 from django.template.loader import render_to_string 9 9 from django.utils.html import escape 10 from django.views.decorators.http import require_POST 10 11 from django.contrib import comments 11 12 from django.contrib.comments import signals 12 13 … … 29 30 errors a preview template, ``comments/preview.html``, will be rendered. 30 31 """ 31 32 32 # Require POST33 if request.method != 'POST':34 return http.HttpResponseNotAllowed(["POST"])35 36 33 # Fill out some initial data fields from an authenticated user, if present 37 34 data = request.POST.copy() 38 35 if request.user.is_authenticated(): … … 116 113 ) 117 114 118 115 return next_redirect(data, next, comment_done, c=comment._get_pk_val()) 116 post_comment = require_POST(post_comment) 119 117 120 118 comment_done = confirmation_view( 121 119 template = "comments/posted.html",