diff --git a/django/contrib/comments/templatetags/comments.py b/django/contrib/comments/templatetags/comments.py
index 9f8180a..8d15def 100644
a
|
b
|
from django.conf import settings
|
4 | 4 | from django.contrib.contenttypes.models import ContentType |
5 | 5 | from django.contrib import comments |
6 | 6 | from django.utils.encoding import smart_unicode |
| 7 | from django.contrib.auth.models import AnonymousUser |
7 | 8 | |
8 | 9 | register = template.Library() |
9 | 10 | |
… |
… |
class CommentFormNode(BaseCommentNode):
|
124 | 125 | def get_form(self, context): |
125 | 126 | ctype, object_pk = self.get_target_ctype_pk(context) |
126 | 127 | if object_pk: |
127 | | return comments.get_form()(ctype.get_object_for_this_type(pk=object_pk)) |
| 128 | if isinstance(context['user'], AnonymousUser): |
| 129 | initial = {} |
| 130 | else: |
| 131 | initial = {"name" : context['user'].get_full_name() or context['user'].username, |
| 132 | "email" : context['user'].email} |
| 133 | return comments.get_form()(ctype.get_object_for_this_type(pk=object_pk), initial=initial) |
128 | 134 | else: |
129 | 135 | return None |
130 | 136 | |