summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2013-02-12 17:10:36 -0700
committerCarl Meyer <carl@oddbird.net>2013-02-12 17:10:36 -0700
commit3a002db6f1ef98d04634911808f9cf1b8e9dceff (patch)
tree11987fc682e6feaadad89b97c9310722a813725e
parentfafee74306e869c23edcef864f9d816565a5c4a2 (diff)
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 ef2790f2db..6b1bea15f3 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({