changeset 3807:2ae602072baf

heads merged
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 30 Jun 2008 21:02:41 +0200
parents 69e35e3ddfe6 (current diff) 191ac1cf5f61 (diff)
children 8c5fbc62dd1d
files
diffstat 2 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/auth/openidrp.py	Mon Jun 30 21:01:55 2008 +0200
+++ b/MoinMoin/auth/openidrp.py	Mon Jun 30 21:02:41 2008 +0200
@@ -135,9 +135,9 @@
         query = {}
         for key in request.form:
             query[key] = request.form[key][0]
-        return_to = get_multistage_continuation_url(request, self.name,
-                                                    {'oidstage': '1'})
-        info = oidconsumer.complete(query, return_to=return_to)
+        current_url = get_multistage_continuation_url(request, self.name,
+                                                      {'oidstage': '1'})
+        info = oidconsumer.complete(query, current_url)
         if info.status == consumer.FAILURE:
             return CancelLogin(_('OpenID error: %s.') % info.message)
         elif info.status == consumer.CANCEL:
--- a/MoinMoin/macro/TableOfContents.py	Mon Jun 30 21:01:55 2008 +0200
+++ b/MoinMoin/macro/TableOfContents.py	Mon Jun 30 21:02:41 2008 +0200
@@ -163,7 +163,21 @@
         macro.formatter.paragraph(0),
     ]
 
-    lastlvl = 0
+
+    # find smallest used level and use that as the outer-most indentation,
+    # to fix pages like HelpOnMacros that only use h2 and lower levels.
+    lastlvl = 100
+    for lvl, id, txt in macro.request._tocfm_collected_headings:
+        if txt is None:
+            incl_id = id
+            continue
+        if lvl > maxdepth or id is None:
+            continue
+        if lvl < lastlvl:
+            lastlvl = lvl
+
+    # headings are 1-based, lastlvl needs to be one less so that one is closed
+    lastlvl -= 1
 
     for lvl, id, txt in macro.request._tocfm_collected_headings:
         if txt is None: