zenodo_accessrequests/ext.py
def verify_token():
    """Verify token and save in session if it's valid."""
    try:
        from .models import SecretLink
        token = request.args['token']
        # if the token is valid
        if token and SecretLink.validate_token(token, {}):
            # then save in session the token
            session['accessrequests-secret-token'] = token
    except KeyError:
        pass
def verify_token():
    try:
        from .models import SecretLink
        token = request.args['token']
        # if the token is valid
        if token and SecretLink.validate_token(token, {}):
            # then save in session the token
            session['accessrequests-secret-token'] = token
    except KeyError:
        pass
def verify_token ( ) : try : from . models import SecretLink token = request . args [ 'token' ] # if the token is valid if token and SecretLink . validate_token ( token , { } ) : # then save in session the token session [ 'accessrequests-secret-token' ] = token except KeyError : pass
Verify token and save in session if it's valid.
Verify token and save in session if it s valid .