Restore previous logout behaviour
authorThierry Florac <thierry.florac@onf.fr>
Tue, 16 Dec 2014 10:45:32 +0100
changeset 98 eaa18e1a6cab
parent 97 0f1415f3d46a
child 99 3973a123af03
Restore previous logout behaviour
src/ztfy/myams/login.py
--- a/src/ztfy/myams/login.py	Tue Dec 16 10:03:50 2014 +0100
+++ b/src/ztfy/myams/login.py	Tue Dec 16 10:45:32 2014 +0100
@@ -11,13 +11,11 @@
 from z3c.json.interfaces import IJSONWriter
 from zope.authentication.interfaces import IAuthentication
 from zope.component.interfaces import ISite
-from zope.publisher.browser import BrowserPage
 from zope.security.interfaces import IUnauthorized
 from zope.session.interfaces import ISession
 
 # import local interfaces
 from ztfy.baseskin.interfaces import IDefaultView, IDialog
-from ztfy.baseskin.viewlet import ContentProviderBase
 from ztfy.myams.interfaces import IModalFullPage
 
 # import Zope3 packages
@@ -25,11 +23,13 @@
 from z3c.formjs import ajax
 from zope.component import adapts, getUtility, getUtilitiesFor, getMultiAdapter, queryMultiAdapter
 from zope.interface import implements, Interface, Invalid
+from zope.publisher.browser import BrowserPage
 from zope.schema import TextLine, Password
 from zope.site import hooks
 from zope.traversing.browser.absoluteurl import absoluteURL
 
 # import local packages
+from ztfy.baseskin.viewlet import ContentProviderBase
 from ztfy.myams.form import AddForm
 from ztfy.myams.layer import MyAMSLayer
 from ztfy.utils.traversing import getParent
@@ -189,5 +189,6 @@
                 hooks.setSite(old_site)
             context = getParent(context, ISite, allow_context=False)
         target = queryMultiAdapter((self.context, self.request, Interface), IDefaultView)
-        self.request.response.redirect(target.viewname if target is not None else '@@index.html')
+        self.request.response.redirect('%s/%s' % (absoluteURL(self.context, self.request),
+                                                  target.viewname if target is not None else '@@index.html'))
         return u''