changeset 5315:329241cd48b6

action.login: bug fix for MoinMoinBugs/LoginDialogIfLoggedIn. A valid user is redirected to the page without the login form.
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 28 Nov 2009 17:32:42 +0100
parents e005834bbf85
children 5060bec6a284 16255e1fe7e8
files MoinMoin/action/login.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/login.py	Sat Nov 28 17:03:28 2009 +0100
+++ b/MoinMoin/action/login.py	Sat Nov 28 17:32:42 2009 +0100
@@ -15,7 +15,11 @@
 from MoinMoin.widget import html
 
 def execute(pagename, request):
-    return LoginHandler(pagename, request).handle()
+    if request.user.valid:
+        url = Page(request, pagename).url(request)
+        request.http_redirect(url)
+    else:
+        return LoginHandler(pagename, request).handle()
 
 class LoginHandler:
     def __init__(self, pagename, request):