Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #985 -- Fixed admin docs behavior if docutils isn't installed. …

…Thanks, Tim Keating

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7106c68e598e0f2ad2036249122222f1adb3b2d1 1 parent 4ed3377
Adrian Holovaty authored December 07, 2005

Showing 1 changed file with 6 additions and 4 deletions. Show diff stats Hide diff stats

  1. 10  django/contrib/admin/utils.py
10  django/contrib/admin/utils.py
@@ -90,8 +90,10 @@ def default_reference_role(name, rawtext, text, lineno, inliner, options={}, con
90 90
     context = inliner.document.settings.default_reference_context
91 91
     node = docutils.nodes.reference(rawtext, text, refuri=(ROLES[context] % (inliner.document.settings.link_base, text)), **options)
92 92
     return [node], []
93  
-docutils.parsers.rst.roles.register_canonical_role('cmsreference', default_reference_role)
94  
-docutils.parsers.rst.roles.DEFAULT_INTERPRETED_ROLE = 'cmsreference'
95 93
 
96  
-for (name, urlbase) in ROLES.items():
97  
-    create_reference_role(name, urlbase)
  94
+if docutils_is_available:
  95
+    docutils.parsers.rst.roles.register_canonical_role('cmsreference', default_reference_role)
  96
+    docutils.parsers.rst.roles.DEFAULT_INTERPRETED_ROLE = 'cmsreference'
  97
+
  98
+    for (name, urlbase) in ROLES.items():
  99
+        create_reference_role(name, urlbase)

0 notes on commit 7106c68

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