def process_non_authorised_user(connection, registered_users, user_name) :
    """
    This method tries to create new YT user for trac non-authorised user.

    Args:
        connection: youtrack.connection object.
         registered_users: list of user logins, that were previously registered in YT.
         user_name: String, that represents user. It must have format "login_name <email_address>".

    Returns:
        New user login and updated list of registered users logins. If it is impossible to create
        new YT user, then user login is None.
    """
    if tracLib.ACCEPT_NON_AUTHORISED_USERS:
        yt_user = to_non_authorised_youtrack_user(user_name)
        if yt_user is None:
            return None, registered_users
        else:
            if not (yt_user.login in registered_users):
                connection.importUsers([yt_user])
                registered_users.add(yt_user.login)
            return yt_user.login, registered_users
    else:
        return None, registered_users
def process_non_authorised_user(connection, registered_users, user_name) :
    """
    This method tries to create new YT user for trac non-authorised user.

    Args:
        connection: youtrack.connection object.
         registered_users: list of user logins, that were previously registered in YT.
         user_name: String, that represents user. It must have format "login_name <email_address>".

    Returns:
        New user login and updated list of registered users logins. If it is impossible to create
        new YT user, then user login is None.
    """
    if youtrackutils.tracLib.ACCEPT_NON_AUTHORISED_USERS:
        yt_user = to_non_authorised_youtrack_user(user_name)
        if yt_user is None:
            return None, registered_users
        else:
            if not (yt_user.login in registered_users):
                connection.importUsers([yt_user])
                registered_users.add(yt_user.login)
            return yt_user.login, registered_users
    else:
        return None, registered_users