summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2013-02-12 17:12:44 -0700
committerCarl Meyer <carl@oddbird.net>2013-02-12 17:12:44 -0700
commitf83bec4847de7853ba3770ccaa05874b9d441e7d (patch)
tree94788395e45235c48dda21194b91a6d2602cd02c
parent743263a1058bb54617446507cbb645aab571ac93 (diff)
[1.5.x] Fix admindocs on Python 3, where None cannot be sorted with strings.
This fixes two tests in admin_views which were failing on Python 3, but only if the tests were run with docutils installed.
-rw-r--r--django/contrib/admindocs/templates/admin_doc/template_filter_index.html4
-rw-r--r--django/contrib/admindocs/templates/admin_doc/template_tag_index.html4
-rw-r--r--django/contrib/admindocs/views.py4
3 files changed, 6 insertions, 6 deletions
diff --git a/django/contrib/admindocs/templates/admin_doc/template_filter_index.html b/django/contrib/admindocs/templates/admin_doc/template_filter_index.html
index 1878e806f4..95d6fcc13e 100644
--- a/django/contrib/admindocs/templates/admin_doc/template_filter_index.html
+++ b/django/contrib/admindocs/templates/admin_doc/template_filter_index.html
@@ -22,7 +22,7 @@
<h2>{% firstof library.grouper "Built-in filters" %}</h2>
{% if library.grouper %}<p class="small quiet">To use these filters, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the filter.</p><hr />{% endif %}
{% for filter in library.list|dictsort:"name" %}
- <h3 id="{{ library.grouper|default_if_none:"built_in" }}-{{ filter.name }}">{{ filter.name }}</h3>
+ <h3 id="{{ library.grouper|default:"built_in" }}-{{ filter.name }}">{{ filter.name }}</h3>
{{ filter.title }}
{{ filter.body }}
{% if not forloop.last %}<hr />{% endif %}
@@ -43,7 +43,7 @@
<h2>{% firstof library.grouper "Built-in filters" %}</h2>
<ul>
{% for filter in library.list|dictsort:"name" %}
- <li><a href="#{{ library.grouper|default_if_none:"built_in" }}-{{ filter.name }}">{{ filter.name }}</a></li>
+ <li><a href="#{{ library.grouper|default:"built_in" }}-{{ filter.name }}">{{ filter.name }}</a></li>
{% endfor %}
</ul>
</div>
diff --git a/django/contrib/admindocs/templates/admin_doc/template_tag_index.html b/django/contrib/admindocs/templates/admin_doc/template_tag_index.html
index 568b118826..37209102fe 100644
--- a/django/contrib/admindocs/templates/admin_doc/template_tag_index.html
+++ b/django/contrib/admindocs/templates/admin_doc/template_tag_index.html
@@ -22,7 +22,7 @@
<h2>{% firstof library.grouper "Built-in tags" %}</h2>
{% if library.grouper %}<p class="small quiet">To use these tags, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the tag.</p><hr />{% endif %}
{% for tag in library.list|dictsort:"name" %}
- <h3 id="{{ library.grouper|default_if_none:"built_in" }}-{{ tag.name }}">{{ tag.name }}</h3>
+ <h3 id="{{ library.grouper|default:"built_in" }}-{{ tag.name }}">{{ tag.name }}</h3>
<h4>{{ tag.title|striptags }}</h4>
{{ tag.body }}
{% if not forloop.last %}<hr />{% endif %}
@@ -43,7 +43,7 @@
<h2>{% firstof library.grouper "Built-in tags" %}</h2>
<ul>
{% for tag in library.list|dictsort:"name" %}
- <li><a href="#{{ library.grouper|default_if_none:"built_in" }}-{{ tag.name }}">{{ tag.name }}</a></li>
+ <li><a href="#{{ library.grouper|default:"built_in" }}-{{ tag.name }}">{{ tag.name }}</a></li>
{% endfor %}
</ul>
</div>
diff --git a/django/contrib/admindocs/views.py b/django/contrib/admindocs/views.py
index cb0c116416..74043c01ad 100644
--- a/django/contrib/admindocs/views.py
+++ b/django/contrib/admindocs/views.py
@@ -62,7 +62,7 @@ def template_tag_index(request):
for key in metadata:
metadata[key] = utils.parse_rst(metadata[key], 'tag', _('tag:') + tag_name)
if library in template.builtins:
- tag_library = None
+ tag_library = ''
else:
tag_library = module_name.split('.')[-1]
tags.append({
@@ -97,7 +97,7 @@ def template_filter_index(request):
for key in metadata:
metadata[key] = utils.parse_rst(metadata[key], 'filter', _('filter:') + filter_name)
if library in template.builtins:
- tag_library = None
+ tag_library = ''
else:
tag_library = module_name.split('.')[-1]
filters.append({