It really looks like this is broken with some new commit.

In 2.14.5 I have - gluon/tools.py 6476-6478
            gid = group.id if group else db.auth_group.insert(
                role='wiki_editor')
            auth.add_membership(gid)

In trunk (and probably 2.14.6) - gluon/tools.py 6506-6510
    if group:
        gid = group.id
    else:
        db.auth_group.insert(role='wiki_editor')
    auth.add_membership(gid)

I see nothing better on the 2nd solution. And there is sure an error 
(ommiting assignment to gid).
I will create a pull request.
Thank you.




Dne pátek 27. května 2016 0:40:32 UTC+2 greenpoise napsal(a):
>
>
> I had never done this part of the book but when I tried, it gave me an 
> error:
>
>
> <type 'exceptions.UnboundLocalError'> local variable 'gid' referenced 
> before assignmentVersion
> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
> Python Python 2.7.11: /usr/bin/python2.7 (prefix: /usr)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
>
> Traceback (most recent call last):
>   File "/home/gs/Applications/web2py/gluon/restricted.py", line 227, in 
> restricted
>     exec ccode in environment
>   File 
> "/home/gs/Applications/web2py/applications/wiki2py/controllers/default.py" 
> <http://localhost:8000/admin/default/edit/wiki2py/controllers/default.py>, 
> line 52, in <module>
>   File "/home/gs/Applications/web2py/gluon/globals.py", line 417, in <lambda>
>     self._caller = lambda f: f()
>   File 
> "/home/gs/Applications/web2py/applications/wiki2py/controllers/default.py" 
> <http://localhost:8000/admin/default/edit/wiki2py/controllers/default.py>, 
> line 13, in index
>     return auth.wiki()
>   File "/home/gs/Applications/web2py/gluon/tools.py", line 4687, in wiki
>     groups=groups)
>   File "/home/gs/Applications/web2py/gluon/tools.py", line 6454, in __init__
>     auth.add_membership(gid)
> UnboundLocalError: local variable 'gid' referenced before assignment
>
>
>
>

-- 
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