Ticket #9614: comments.patch
File comments.patch, 878 bytes (added by , 16 years ago) |
---|
-
comments.py
old new 31 31 """ 32 32 # Fill out some initial data fields from an authenticated user, if present 33 33 data = request.POST.copy() 34 if request.user.is_authenticated():34 if hasattr(request, 'user') and request.user.is_authenticated(): 35 35 if not data.get('name', ''): 36 36 data["name"] = request.user.get_full_name() or request.user.username 37 37 if not data.get('email', ''): … … 87 87 # Otherwise create the comment 88 88 comment = form.get_comment_object() 89 89 comment.ip_address = request.META.get("REMOTE_ADDR", None) 90 if request.user.is_authenticated():90 if hasattr(request, 'user') and request.user.is_authenticated(): 91 91 comment.user = request.user 92 92 93 93 # Signal that the comment is about to be saved