Ticket #12742: 12742.diff

File 12742.diff, 1.8 KB (added by Thejaswi Puthraya, 13 years ago)

generic patch that will also handle both #12742 and #10838

  • django/contrib/comments/forms.py

    diff --git a/django/contrib/comments/forms.py b/django/contrib/comments/forms.py
    index d497572..43a512d 100644
    a b class CommentSecurityForm(forms.Form):  
    2121    timestamp     = forms.IntegerField(widget=forms.HiddenInput)
    2222    security_hash = forms.CharField(min_length=40, max_length=40, widget=forms.HiddenInput)
    2323
    24     def __init__(self, target_object, data=None, initial=None):
     24    def __init__(self, target_object, data=None, initial=None, *args, **kwargs):
    2525        self.target_object = target_object
    2626        if initial is None:
    2727            initial = {}
    2828        initial.update(self.generate_security_data())
    29         super(CommentSecurityForm, self).__init__(data=data, initial=initial)
     29        super(CommentSecurityForm, self).__init__(data=data, initial=initial, *args, **kwargs)
    3030
    3131    def security_errors(self):
    3232        """Return just those errors associated with security"""
  • django/contrib/comments/views/comments.py

    diff --git a/django/contrib/comments/views/comments.py b/django/contrib/comments/views/comments.py
    index c2b553f..aabbd8d 100644
    a b class CommentPostBadRequest(http.HttpResponseBadRequest):  
    2525
    2626@csrf_protect
    2727@require_POST
    28 def post_comment(request, next=None, using=None):
     28def post_comment(request, next=None, using=None, *args, **kwargs):
    2929    """
    3030    Post a comment.
    3131
    def post_comment(request, next=None, using=None):  
    7171    preview = "preview" in data
    7272
    7373    # Construct the comment form
    74     form = comments.get_form()(target, data=data)
     74    form = comments.get_form()(target, data=data, *args, **kwargs)
    7575
    7676    # Check security information
    7777    if form.security_errors():
Back to Top