Index: django/contrib/comments/forms.py =================================================================== --- django/contrib/comments/forms.py (wersja 12358) +++ django/contrib/comments/forms.py (kopia robocza) @@ -22,12 +22,15 @@ timestamp = forms.IntegerField(widget=forms.HiddenInput) security_hash = forms.CharField(min_length=40, max_length=40, widget=forms.HiddenInput) - def __init__(self, target_object, data=None, initial=None): + # use *args and **kwrgs as __init__args to allow super to work + # properly and handle e.g. request.FILES in post handler + def __init__(self, target_object, data=None, initial=None, *args, **kwargs): self.target_object = target_object if initial is None: initial = {} initial.update(self.generate_security_data()) - super(CommentSecurityForm, self).__init__(data=data, initial=initial) + # super did not use *arts, and **kwargs, + super(CommentSecurityForm, self).__init__(data=data, initial=initial, *args, **kwargs) def security_errors(self): """Return just those errors associated with security""" Index: django/contrib/comments/views/comments.py =================================================================== --- django/contrib/comments/views/comments.py (wersja 12358) +++ django/contrib/comments/views/comments.py (kopia robocza) @@ -67,7 +67,8 @@ preview = "preview" in data # Construct the comment form - form = comments.get_form()(target, data=data) + # NEW: added files=request.FILES support + form = comments.get_form()(target, data=data, files=request.FILES) # Check security information if form.security_errors(): Index: django/contrib/comments/templates/comments/form.html =================================================================== --- django/contrib/comments/templates/comments/form.html (wersja 12358) +++ django/contrib/comments/templates/comments/form.html (kopia robocza) @@ -1,5 +1,5 @@ {% load comments i18n %} -