Mercurial > moin > 1.9
changeset 3805:191ac1cf5f61
merge two fixes from 1.7
author | Johannes Berg <johannes AT sipsolutions DOT net> |
---|---|
date | Mon, 30 Jun 2008 16:59:30 +0200 |
parents | 88b2eecd1fed (current diff) 6f3dbd8430db (diff) |
children | 2ae602072baf |
files | |
diffstat | 2 files changed, 18 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/auth/openidrp.py Sat Jun 28 15:36:31 2008 +0200 +++ b/MoinMoin/auth/openidrp.py Mon Jun 30 16:59:30 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 Sat Jun 28 15:36:31 2008 +0200 +++ b/MoinMoin/macro/TableOfContents.py Mon Jun 30 16:59:30 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: