1. Peter Nixon
  2. django-hgwiki

Commits

Peter Nixon  committed 946c55d

rstrip() does NOT work the way you think it does!

  • Participants
  • Parent commits d881bab
  • Branches default

Comments (0)

Files changed (1)

File hgwiki/views.py

View file
     root = repo.request('', 'tip')
     pages = root.files
 
-    base_url = request.path.rstrip('list/')
+    # Cut "/list/" from the end of the path
+    (base_url, tail) = os.path.split(request.path.rstrip('/'))
 
     return render_to_response("hgwiki/page_list.html", {
         "base_url": base_url,
     # FIXME: Handle missing HGWIKI_DIRECTORY_PATH
     pages = listDirectory(settings.HGWIKI_DIRECTORY_PATH)
 
-    base_url = request.path.rstrip('list/')
+    # Cut "/list/" from the end of the path
+    (base_url, tail) = os.path.split(request.path.rstrip('/'))
 
     return render_to_response("hgwiki/page_list.html", {
         "base_url": base_url,