Note that decorators need a function as an argument and should return 
another function, given that knowledge you just need to change your 
function a bit

def emailConfirmed(fun):
    def decorated():
        if session.abit_email is None:
            redirect(URL('default','index'))
        else:
            confirmed = db_xml((db_xml.abit_validation_codes.A_EMAIL==
session.abit_email) & (db_xml.abit_validation_codes.CONFIRMED==1)).select().
first()
            if confirmed is None:
                redirect(URL('default','index'))
            else:
                return fun()
    return decorated



-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/cba11314-9162-402b-9b15-53c9dde966da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to