From 4035ea3538cbcada11cb73680189c11e789064a9 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Mon, 12 Jan 2009 17:27:41 +0000 Subject: [PATCH] A few small fixes to django.contrib.comments (Comment.get_as_text for non-authenticated users; references to Comment.permalink; unused imports). Fixes #9143, #9429, and 9439. Thanks, Thejaswi Puthraya. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9730 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/comments/admin.py | 1 - django/contrib/comments/forms.py | 2 -- django/contrib/comments/managers.py | 1 - django/contrib/comments/models.py | 2 +- django/contrib/comments/templates/comments/approve.html | 2 +- django/contrib/comments/templates/comments/delete.html | 2 +- django/contrib/comments/templates/comments/flag.html | 2 +- django/contrib/comments/urls.py | 1 - django/contrib/comments/views/utils.py | 1 - 9 files changed, 4 insertions(+), 10 deletions(-) diff --git a/django/contrib/comments/admin.py b/django/contrib/comments/admin.py index 21ce62229a..11271c9d5b 100644 --- a/django/contrib/comments/admin.py +++ b/django/contrib/comments/admin.py @@ -1,5 +1,4 @@ from django.contrib import admin -from django.conf import settings from django.contrib.comments.models import Comment from django.utils.translation import ugettext_lazy as _ diff --git a/django/contrib/comments/forms.py b/django/contrib/comments/forms.py index 713269fbe2..5d71a3909b 100644 --- a/django/contrib/comments/forms.py +++ b/django/contrib/comments/forms.py @@ -1,11 +1,9 @@ -import re import time import datetime from django import forms from django.forms.util import ErrorDict from django.conf import settings -from django.http import Http404 from django.contrib.contenttypes.models import ContentType from models import Comment from django.utils.encoding import force_unicode diff --git a/django/contrib/comments/managers.py b/django/contrib/comments/managers.py index a1ac8097da..499feee6c3 100644 --- a/django/contrib/comments/managers.py +++ b/django/contrib/comments/managers.py @@ -1,5 +1,4 @@ from django.db import models -from django.dispatch import dispatcher from django.contrib.contenttypes.models import ContentType from django.utils.encoding import force_unicode diff --git a/django/contrib/comments/models.py b/django/contrib/comments/models.py index c0613dc526..56642b2778 100644 --- a/django/contrib/comments/models.py +++ b/django/contrib/comments/models.py @@ -140,7 +140,7 @@ class Comment(BaseCommentAbstractModel): Return this comment as plain text. Useful for emails. """ d = { - 'user': self.user, + 'user': self.user or self.name, 'date': self.submit_date, 'comment': self.comment, 'domain': self.site.domain, diff --git a/django/contrib/comments/templates/comments/approve.html b/django/contrib/comments/templates/comments/approve.html index 3bc8d2bd6c..e6b114114e 100644 --- a/django/contrib/comments/templates/comments/approve.html +++ b/django/contrib/comments/templates/comments/approve.html @@ -9,7 +9,7 @@

- or cancel + or cancel

{% endblock %} diff --git a/django/contrib/comments/templates/comments/delete.html b/django/contrib/comments/templates/comments/delete.html index 1e7d248c51..33688993aa 100644 --- a/django/contrib/comments/templates/comments/delete.html +++ b/django/contrib/comments/templates/comments/delete.html @@ -9,7 +9,7 @@

- or cancel + or cancel

{% endblock %} diff --git a/django/contrib/comments/templates/comments/flag.html b/django/contrib/comments/templates/comments/flag.html index 7a9df5fdef..7f0e384c86 100644 --- a/django/contrib/comments/templates/comments/flag.html +++ b/django/contrib/comments/templates/comments/flag.html @@ -9,7 +9,7 @@

- or cancel + or cancel

{% endblock %} diff --git a/django/contrib/comments/urls.py b/django/contrib/comments/urls.py index 8fe4fbb6e4..ae0b7ff1e8 100644 --- a/django/contrib/comments/urls.py +++ b/django/contrib/comments/urls.py @@ -1,5 +1,4 @@ from django.conf.urls.defaults import * -from django.conf import settings urlpatterns = patterns('django.contrib.comments.views', url(r'^post/$', 'comments.post_comment', name='comments-post-comment'), diff --git a/django/contrib/comments/views/utils.py b/django/contrib/comments/views/utils.py index e094ffa6e5..a37c555e78 100644 --- a/django/contrib/comments/views/utils.py +++ b/django/contrib/comments/views/utils.py @@ -9,7 +9,6 @@ from django.core import urlresolvers from django.shortcuts import render_to_response from django.template import RequestContext from django.core.exceptions import ObjectDoesNotExist -from django.conf import settings from django.contrib import comments def next_redirect(data, default, default_view, **get_kwargs):