Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…Thanks, Tim Keating

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7106c68e598e0f2ad2036249122222f1adb3b2d1 1 parent 4ed3377
Adrian Holovaty adrianholovaty authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 django/contrib/admin/
10 django/contrib/admin/
@@ -90,8 +90,10 @@ def default_reference_role(name, rawtext, text, lineno, inliner, options={}, con
context = inliner.document.settings.default_reference_context
node = docutils.nodes.reference(rawtext, text, refuri=(ROLES[context] % (inliner.document.settings.link_base, text)), **options)
return [node], []
-docutils.parsers.rst.roles.register_canonical_role('cmsreference', default_reference_role)
-docutils.parsers.rst.roles.DEFAULT_INTERPRETED_ROLE = 'cmsreference'
-for (name, urlbase) in ROLES.items():
- create_reference_role(name, urlbase)
+if docutils_is_available:
+ docutils.parsers.rst.roles.register_canonical_role('cmsreference', default_reference_role)
+ docutils.parsers.rst.roles.DEFAULT_INTERPRETED_ROLE = 'cmsreference'
+ for (name, urlbase) in ROLES.items():
+ create_reference_role(name, urlbase)
Please sign in to comment.
Something went wrong with that request. Please try again.