Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit 3a002db6f1ef98d04634911808f9cf1b8e9dceff 1 parent fafee74
@carljm carljm authored
View
4 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 @@ <h3 id="{{ library.grouper|default_if_none:"built_in" }}-{{ filter.name }}">{{ f
<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>
View
4 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 @@ <h3 id="{{ library.grouper|default_if_none:"built_in" }}-{{ tag.name }}">{{ tag.
<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>
View
4 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({
Please sign in to comment.
Something went wrong with that request. Please try again.