fixed issue 1118, reload page when called by component, thanks Paolo

This commit is contained in:
mdipierro
2012-10-29 09:28:19 -05:00
parent 6e0e48e150
commit 54b98b4e05
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.2.1 (2012-10-29 09:06:49) stable
Version 2.2.1 (2012-10-29 09:28:14) stable
+6 -1
View File
@@ -140,7 +140,7 @@ class HTTP(BaseException):
return self.message
def redirect(location, how=303, client_side=False):
def redirect(location='', how=303, client_side=False):
if location:
from gluon import current
loc = location.replace('\r', '%0D').replace('\n', '%0A')
@@ -150,3 +150,8 @@ def redirect(location, how=303, client_side=False):
raise HTTP(how,
'You are being redirected <a href="%s">here</a>' % loc,
Location=loc)
else:
from gluon import current
if client_side and current.request.ajax:
raise HTTP(200, **{'web2py-component-command': 'window.location.reload(true)'})