Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed #8971: correctly reverse urls in admindocs reST roles. …

…Thanks, mitsuhiko. Backport of [10683] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10685 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 643e914d2b769881504132a9be1cf8efbdc05bd3 1 parent fc15d69
Jacob Kaplan-Moss authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  django/contrib/admindocs/utils.py
5  django/contrib/admindocs/utils.py
@@ -4,6 +4,7 @@
4 4
 from email.Parser import HeaderParser
5 5
 from email.Errors import HeaderParseError
6 6
 from django.utils.safestring import mark_safe
  7
+from django.core.urlresolvers import reverse
7 8
 try:
8 9
     import docutils.core
9 10
     import docutils.nodes
@@ -52,7 +53,7 @@ def parse_docstring(docstring):
52 53
                 body = "\n\n".join(parts[1:])
53 54
     return title, body, metadata
54 55
 
55  
-def parse_rst(text, default_reference_context, thing_being_parsed=None, link_base='../..'):
  56
+def parse_rst(text, default_reference_context, thing_being_parsed=None):
56 57
     """
57 58
     Convert the string from reST to an XHTML fragment.
58 59
     """
@@ -60,7 +61,7 @@ def parse_rst(text, default_reference_context, thing_being_parsed=None, link_bas
60 61
         'doctitle_xform' : True,
61 62
         'inital_header_level' : 3,
62 63
         "default_reference_context" : default_reference_context,
63  
-        "link_base" : link_base,
  64
+        "link_base" : reverse('django-admindocs-docroot').rstrip('/')
64 65
     }
65 66
     if thing_being_parsed:
66 67
         thing_being_parsed = "<%s>" % thing_being_parsed

0 notes on commit 643e914

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