Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 4035ea3538cbcada11cb73680189c11e789064a9 1 parent 11d382c
@jacobian jacobian authored
View
1  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 _
View
2  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
View
1  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
View
2  django/contrib/comments/models.py
@@ -140,7 +140,7 @@ def get_as_text(self):
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,
View
2  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 %}
View
2  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 %}
View
2  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 %}
View
1  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'),
View
1  django/contrib/comments/views/utils.py
@@ -9,7 +9,6 @@
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):
Please sign in to comment.
Something went wrong with that request. Please try again.