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)
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)
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)