Funny I just finish by figure it out how make an user redirected where he
was coming from after submitting a form... So I have a A() button like
yours and where I construct _next var like that :

vars=dict(_next=urllib.quote(URL(request.controller, request.function,
args=request.args, vars=request.get_vars)))

Then I redirect like that once form pass :

redirect(urllib.unquote(request.vars._next))

It works under web2py 2.9.5, not tested under 2.9.11, but I can't see that
it could failed...

So, for you just surrounding you _next=URL() by urllib.quote() may help...

_next=urllib.quote(URL('myleonexus', 'grouphandler', 'connect',
args=[request.args(0), subgroupID]))

Don't forget to unquote then...

Richard

On Wed, Jan 28, 2015 at 5:30 AM, Annet <anneve...@googlemail.com> wrote:

> I have the following code in a view:
>
> <a class="btn btn-default btn-sm"
> onclick="javascript:openwindow('{{=URL('myleonexus', 'default', 'user',
> args='login', vars=dict(_next=URL('myleonexus', 'grouphandler', 'connect',
> args=[request.args(0), subgroupID])))}}', 'connect')" role="button">Join</a>
>
> This worked, but today I found in no longer does, I get the following
> error:
>
>
> Ticket ID
>
> 127.0.0.1.2015-01-28.11-09-36.390487e8-c391-4364-8cbc-b36bdf0634bc
> <type 'exceptions.TypeError'> argument of type 'NoneType' is not iterable
> Version  web2py™ Version 2.9.11-stable+timestamp.2014.09.15.23.35.11
> Python Python 2.7.5: /usr/bin/python (prefix:
> /System/Library/Frameworks/Python.framework/Versions/2.7)  Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
>
> Traceback (most recent call last):
>   File "/Users/iannet/web2py_db/gluon/restricted.py", line 224, in restricted
>     exec ccode in environment
>   File 
> "/Users/iannet/web2py_db/applications/myleonexus/controllers/default.py" 
> <http://127.0.0.1:8000/admin/default/edit/myleonexus/controllers/default.py>, 
> line 501, in <module>
>   File "/Users/iannet/web2py_db/gluon/globals.py", line 392, in <lambda>
>     self._caller = lambda f: f()
>   File 
> "/Users/iannet/web2py_db/applications/myleonexus/controllers/default.py" 
> <http://127.0.0.1:8000/admin/default/edit/myleonexus/controllers/default.py>, 
> line 139, in user
>     form = auth()
>   File "/Users/iannet/web2py_db/gluon/tools.py", line 1437, in __call__
>     return getattr(self, args[0])()
>   File "/Users/iannet/web2py_db/gluon/tools.py", line 2356, in login
>     if host_next in settings.cas_domains:
> TypeError: argument of type 'NoneType' is not iterable
>
>
>
> Variables host_next '127.0.0.1:8000'  settings.cas_domains None  settings 
> <Storage
> {'verify_email_onaccept': [], 'register...sername_next':
> '/myleonexus/default/user/login'}>
>
>
>
> What changed between versions that causes my code to break, how do I get
> this to work again?
>
>
> Kind regards,
>
> Annet
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to