appy.gen: implemented ToolMixin.performLogin (inspired from Plone authentication), minor bugfix while redirecting user to a page that must display a global status message; logged every translation deletion.

This commit is contained in:
Gaetan Delannay 2011-02-15 15:59:55 +01:00
parent 91c657238d
commit 6473ca8ef0
3 changed files with 34 additions and 2 deletions

View file

@ -358,7 +358,12 @@ class BaseMixin:
def goto(self, url, msg=None):
'''Brings the user to some p_url after an action has been executed.'''
if msg:
url += '?' + urllib.urlencode([('portal_status_message',msg)])
# Remove previous message if any
if 'portal_status_message=' in url:
url = url[:url.find('portal_status_message=')-1]
if '?' in url: op = '&'
else: op = '?'
url += op + urllib.urlencode([('portal_status_message',msg)])
return self.REQUEST.RESPONSE.redirect(url)
def showField(self, name, layoutType='view'):