# HG changeset patch # User Thierry Florac # Date 1418723132 -3600 # Node ID eaa18e1a6cab695fa111d86cdc62db65c023bcc6 # Parent 0f1415f3d46a1f1affb37774556f10eabd952c86 Restore previous logout behaviour diff -r 0f1415f3d46a -r eaa18e1a6cab 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''