fixed issue 1118, reload page when called by component, thanks Paolo
This commit is contained in:
@@ -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
@@ -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)'})
|
||||
|
||||
Reference in New Issue
Block a user