From f83bec4847de7853ba3770ccaa05874b9d441e7d Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Tue, 12 Feb 2013 17:12:44 -0700 Subject: [PATCH] [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. --- .../admindocs/templates/admin_doc/template_filter_index.html | 4 ++-- .../admindocs/templates/admin_doc/template_tag_index.html | 4 ++-- django/contrib/admindocs/views.py | 4 ++-- 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 1878e806f42..95d6fcc13e6 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 @@

{% firstof library.grouper "Built-in filters" %}

{% if library.grouper %}

To use these filters, put {% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %} in your template before using the filter.


{% endif %} {% for filter in library.list|dictsort:"name" %} -

{{ filter.name }}

+

{{ filter.name }}

{{ filter.title }} {{ filter.body }} {% if not forloop.last %}
{% endif %} @@ -43,7 +43,7 @@

{% firstof library.grouper "Built-in filters" %}

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 568b1188263..37209102fe3 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 @@

{% firstof library.grouper "Built-in tags" %}

{% if library.grouper %}

To use these tags, put {% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %} in your template before using the tag.


{% endif %} {% for tag in library.list|dictsort:"name" %} -

{{ tag.name }}

+

{{ tag.name }}

{{ tag.title|striptags }}

{{ tag.body }} {% if not forloop.last %}
{% endif %} @@ -43,7 +43,7 @@

{% firstof library.grouper "Built-in tags" %}

diff --git a/django/contrib/admindocs/views.py b/django/contrib/admindocs/views.py index cb0c1164164..74043c01ad4 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({