From 0cc51e8fdd7cbc08f108bfed7d701bd9cb604860 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Wed, 14 Jan 2009 17:00:15 +0000 Subject: [PATCH] A handful of fixes to django.contrib.comments: * Fixed #9143, #9429, and #9439 (was r9730 on trunk) * Fixed #9959: comment preview documentation example (was r9731 on trunk) * Fixed #9346: comment upgrade SQL in documentation. (was r9732 on trunk). git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9738 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 - docs/ref/contrib/comments/index.txt | 2 +- docs/ref/contrib/comments/upgrade.txt | 2 +- 11 files changed, 6 insertions(+), 12 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): diff --git a/docs/ref/contrib/comments/index.txt b/docs/ref/contrib/comments/index.txt index b6812a8e32..5aeebe32d7 100644 --- a/docs/ref/contrib/comments/index.txt +++ b/docs/ref/contrib/comments/index.txt @@ -156,7 +156,7 @@ A complete form might look like::
{{ form }}

- +

diff --git a/docs/ref/contrib/comments/upgrade.txt b/docs/ref/contrib/comments/upgrade.txt index ff70547cd4..b3656f31dd 100644 --- a/docs/ref/contrib/comments/upgrade.txt +++ b/docs/ref/contrib/comments/upgrade.txt @@ -48,7 +48,7 @@ run the following SQL: comment, submit_date, ip_address, is_public, is_removed) SELECT content_type_id, object_id, site_id, person_name, '', '', comment, - submit_date, ip_address, is_public, approved + submit_date, ip_address, is_public, not approved FROM comments_freecomment; INSERT INTO django_comments