summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-01-12 17:27:41 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-01-12 17:27:41 +0000
commit4035ea3538cbcada11cb73680189c11e789064a9 (patch)
tree0d34e36846d5584df3dbb1c7c56449a5da95228d
parent11d382c6c449a86be794546a27afef63027d1a90 (diff)
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
-rw-r--r--django/contrib/comments/admin.py1
-rw-r--r--django/contrib/comments/forms.py2
-rw-r--r--django/contrib/comments/managers.py1
-rw-r--r--django/contrib/comments/models.py2
-rw-r--r--django/contrib/comments/templates/comments/approve.html2
-rw-r--r--django/contrib/comments/templates/comments/delete.html2
-rw-r--r--django/contrib/comments/templates/comments/flag.html2
-rw-r--r--django/contrib/comments/urls.py1
-rw-r--r--django/contrib/comments/views/utils.py1
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 @@
<form action="." method="post">
<input type="hidden" name="next" value="{{ next }}" id="next" />
<p class="submit">
- <input type="submit" name="submit" value="{% trans "Approve" %}" /> or <a href="{{ comment.permalink }}">cancel</a>
+ <input type="submit" name="submit" value="{% trans "Approve" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
</p>
</form>
{% 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 @@
<form action="." method="post">
<input type="hidden" name="next" value="{{ next }}" id="next" />
<p class="submit">
- <input type="submit" name="submit" value="{% trans "Remove" %}" /> or <a href="{{ comment.permalink }}">cancel</a>
+ <input type="submit" name="submit" value="{% trans "Remove" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
</p>
</form>
{% 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 @@
<form action="." method="post">
<input type="hidden" name="next" value="{{ next }}" id="next" />
<p class="submit">
- <input type="submit" name="submit" value="{% trans "Flag" %}" /> or <a href="{{ comment.permalink }}">cancel</a>
+ <input type="submit" name="submit" value="{% trans "Flag" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
</p>
</form>
{% 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):