'Checks if the provided email/username is allowed to register.'

def check_registration_allowed(self, email, username, password):

    message = ''
    status = 'done'
    for (provider, options) in self.active_authenticators(email, username, password):
        allow_reg = _get_tri_state(options, 'allow-register', True)
        if (allow_reg is None):
            (auth_result, msg) = provider.authenticate(email, username, password, options)
            if (auth_result is True):
                break
            if (auth_result is None):
                message = 'Invalid    email    address/username    or    password.'
                status = 'error'
                break
        elif (allow_reg is True):
            break
        elif (allow_reg is False):
            message = 'Account    registration    not    required    for    your    account.        Please    simply    login.'
            status = 'error'
            break
    return (message, status)
