Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 0cc51e8fdd7cbc08f108bfed7d701bd9cb604860 1 parent 7dd0abc
Jacob Kaplan-Moss authored January 14, 2009
1  django/contrib/comments/admin.py
... ...
@@ -1,5 +1,4 @@
1 1
 from django.contrib import admin
2  
-from django.conf import settings
3 2
 from django.contrib.comments.models import Comment
4 3
 from django.utils.translation import ugettext_lazy as _
5 4
 
2  django/contrib/comments/forms.py
... ...
@@ -1,11 +1,9 @@
1  
-import re
2 1
 import time
3 2
 import datetime
4 3
 
5 4
 from django import forms
6 5
 from django.forms.util import ErrorDict
7 6
 from django.conf import settings
8  
-from django.http import Http404
9 7
 from django.contrib.contenttypes.models import ContentType
10 8
 from models import Comment
11 9
 from django.utils.encoding import force_unicode
1  django/contrib/comments/managers.py
... ...
@@ -1,5 +1,4 @@
1 1
 from django.db import models
2  
-from django.dispatch import dispatcher
3 2
 from django.contrib.contenttypes.models import ContentType
4 3
 from django.utils.encoding import force_unicode
5 4
 
2  django/contrib/comments/models.py
@@ -140,7 +140,7 @@ def get_as_text(self):
140 140
         Return this comment as plain text.  Useful for emails.
141 141
         """
142 142
         d = {
143  
-            'user': self.user,
  143
+            'user': self.user or self.name,
144 144
             'date': self.submit_date,
145 145
             'comment': self.comment,
146 146
             'domain': self.site.domain,
2  django/contrib/comments/templates/comments/approve.html
@@ -9,7 +9,7 @@
9 9
   <form action="." method="post">
10 10
     <input type="hidden" name="next" value="{{ next }}" id="next" />
11 11
     <p class="submit">
12  
-      <input type="submit" name="submit" value="{% trans "Approve" %}" /> or <a href="{{ comment.permalink }}">cancel</a>
  12
+      <input type="submit" name="submit" value="{% trans "Approve" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
13 13
     </p>
14 14
   </form>
15 15
 {% endblock %}
2  django/contrib/comments/templates/comments/delete.html
@@ -9,7 +9,7 @@
9 9
   <form action="." method="post">
10 10
     <input type="hidden" name="next" value="{{ next }}" id="next" />
11 11
     <p class="submit">
12  
-    <input type="submit" name="submit" value="{% trans "Remove" %}" /> or <a href="{{ comment.permalink }}">cancel</a>
  12
+    <input type="submit" name="submit" value="{% trans "Remove" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
13 13
     </p>
14 14
   </form>
15 15
 {% endblock %}
2  django/contrib/comments/templates/comments/flag.html
@@ -9,7 +9,7 @@
9 9
   <form action="." method="post">
10 10
     <input type="hidden" name="next" value="{{ next }}" id="next" />
11 11
     <p class="submit">
12  
-    <input type="submit" name="submit" value="{% trans "Flag" %}" /> or <a href="{{ comment.permalink }}">cancel</a>
  12
+    <input type="submit" name="submit" value="{% trans "Flag" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
13 13
     </p>
14 14
   </form>
15 15
 {% endblock %}
1  django/contrib/comments/urls.py
... ...
@@ -1,5 +1,4 @@
1 1
 from django.conf.urls.defaults import *
2  
-from django.conf import settings
3 2
 
4 3
 urlpatterns = patterns('django.contrib.comments.views',
5 4
     url(r'^post/$',          'comments.post_comment',       name='comments-post-comment'),
1  django/contrib/comments/views/utils.py
@@ -9,7 +9,6 @@
9 9
 from django.shortcuts import render_to_response
10 10
 from django.template import RequestContext
11 11
 from django.core.exceptions import ObjectDoesNotExist
12  
-from django.conf import settings
13 12
 from django.contrib import comments
14 13
 
15 14
 def next_redirect(data, default, default_view, **get_kwargs):
2  docs/ref/contrib/comments/index.txt
@@ -156,7 +156,7 @@ A complete form might look like::
156 156
     <form action="{% comment_form_target %}" method="POST">
157 157
       {{ form }}
158 158
       <p class="submit">
159  
-        <input type="submit" name="submit" class="submit-post" value="Preview">
  159
+        <input type="submit" name="preview" class="submit-post" value="Preview">
160 160
       </p>
161 161
     </form>
162 162
     
2  docs/ref/contrib/comments/upgrade.txt
@@ -48,7 +48,7 @@ run the following SQL:
48 48
         comment, submit_date, ip_address, is_public, is_removed)
49 49
     SELECT
50 50
         content_type_id, object_id, site_id, person_name, '', '', comment,
51  
-        submit_date, ip_address, is_public, approved
  51
+        submit_date, ip_address, is_public, not approved
52 52
     FROM comments_freecomment;
53 53
 
54 54
     INSERT INTO django_comments 

0 notes on commit 0cc51e8

Please sign in to comment.
Something went wrong with that request. Please try again.