コード例 #1
0
ファイル: __init__.py プロジェクト: Janaba/adhocracy3
def add_image_reference_to_users(root, registry):  # pragma: no cover
    """Add image reference to users and add assets service to users service."""
    users = find_service(root, 'principals', 'users')
    if not IHasAssetPool.providedBy(users):
        logger.info('Add assets service to {0}'.format(users))
        add_assets_service(users, registry, {})
    migrate_new_sheet(root, IUsersService, IHasAssetPool)
    migrate_new_sheet(root, IUser, IImageReference)
コード例 #2
0
ファイル: __init__.py プロジェクト: olivierh59500/adhocracy3
def add_image_reference_to_users(root, registry):  # pragma: no cover
    """Add image reference to users and add assets service to users service."""
    users = find_service(root, 'principals', 'users')
    if not IHasAssetPool.providedBy(users):
        logger.info('Add assets service to {0}'.format(users))
        add_assets_service(users, registry, {})
    migrate_new_sheet(root, IUsersService, IHasAssetPool)
    migrate_new_sheet(root, IUser, IImageReference)
コード例 #3
0
ファイル: __init__.py プロジェクト: pra85/adhocracy3
def add_image_reference_to_users(root):  # pragma: no cover
    """Add image reference to users and add assets service to users service."""
    registry = get_current_registry(root)
    users = find_service(root, "principals", "users")
    if not IHasAssetPool.providedBy(users):
        logger.info("Add assets service to {0}".format(users))
        add_assets_service(users, registry, {})
    migrate_new_sheet(root, IUsersService, IHasAssetPool)
    migrate_new_sheet(root, IUser, IImageReference)
コード例 #4
0
ファイル: __init__.py プロジェクト: Janaba/adhocracy3
def add_image_reference_to_organisations(root, registry):  # pragma: no cover
    """Add image reference to organisations and add assets service."""
    catalogs = find_service(root, 'catalogs')
    query = search_query._replace(interfaces=(IOrganisation,), resolve=True)
    organisations = catalogs.search(query).elements
    for organisation in organisations:
        if not IHasAssetPool.providedBy(organisation):
            logger.info('Add assets service to {0}'.format(organisation))
            add_assets_service(organisation, registry, {})
    migrate_new_sheet(root, IOrganisation, IHasAssetPool)
    migrate_new_sheet(root, IOrganisation, IImageReference)
コード例 #5
0
ファイル: __init__.py プロジェクト: olivierh59500/adhocracy3
def add_image_reference_to_organisations(root, registry):  # pragma: no cover
    """Add image reference to organisations and add assets service."""
    catalogs = find_service(root, 'catalogs')
    query = search_query._replace(interfaces=(IOrganisation,), resolve=True)
    organisations = catalogs.search(query).elements
    for organisation in organisations:
        if not IHasAssetPool.providedBy(organisation):
            logger.info('Add assets service to {0}'.format(organisation))
            add_assets_service(organisation, registry, {})
    migrate_new_sheet(root, IOrganisation, IHasAssetPool)
    migrate_new_sheet(root, IOrganisation, IImageReference)
コード例 #6
0
ファイル: root.py プロジェクト: Janaba/adhocracy3
def create_initial_content_for_app_root(context: IPool, registry: Registry,
                                        options: dict):
    """Add the Catalog, principals services to the context."""
    _add_objectmap_to_app_root(context)
    _add_graph(context, registry)
    _add_catalog_service(context, registry)
    _add_principals_service(context, registry)
    _add_default_group(context, registry)
    _add_initial_user_and_group(context, registry)
    add_locations_service(context, registry, {})
    add_assets_service(context, registry, {})
コード例 #7
0
def create_initial_content_for_app_root(context: IPool, registry: Registry,
                                        options: dict):
    """Add the Catalog, principals services to the context."""
    _add_objectmap_to_app_root(context)
    _add_graph(context, registry)
    _add_catalog_service(context, registry)
    _add_principals_service(context, registry)
    _add_default_group(context, registry)
    _add_initial_user_and_group(context, registry)
    _add_anonymous_user(context, registry)
    add_locations_service(context, registry, {})
    add_assets_service(context, registry, {})
    add_page_service(context, registry, {})
    add_activiy_service(context, registry, {})