|
36 | 36 | from onyx.connectors.models import ImageSection
|
37 | 37 | from onyx.connectors.models import SlimDocument
|
38 | 38 | from onyx.connectors.models import TextSection
|
39 |
| -from onyx.db.engine import get_session_with_current_tenant |
| 39 | +from onyx.db.engine.sql_engine import get_session_with_current_tenant |
40 | 40 | from onyx.file_processing.extract_file_text import extract_file_text
|
41 | 41 | from onyx.file_processing.image_utils import store_image_and_create_section
|
42 | 42 | from onyx.indexing.indexing_heartbeat import IndexingHeartbeatInterface
|
@@ -358,10 +358,11 @@ def _process_image_attachment(
|
358 | 358 | section, file_name = store_image_and_create_section(
|
359 | 359 | db_session=db_session,
|
360 | 360 | image_data=raw_bytes,
|
361 |
| - file_name=str(attachment["id"]), |
| 361 | + file_id=str(attachment["id"]), # correct param to identify image |
362 | 362 | display_name=attachment.get(
|
363 | 363 | "name", attachment.get("fileName", "Unknown")
|
364 | 364 | ),
|
| 365 | + link=None, # no direct link for stored images |
365 | 366 | media_type=media_type,
|
366 | 367 | file_origin=FileOrigin.CONNECTOR,
|
367 | 368 | )
|
@@ -606,7 +607,7 @@ def _process_page(self, page: DrupalWikiPage) -> Document | ConnectorFailure:
|
606 | 607 | elif result.get("file_name") and self.allow_images:
|
607 | 608 | # Image attachment - create ImageSection only if allow_images is True
|
608 | 609 | image_section = ImageSection(
|
609 |
| - image_file_name=result["file_name"], link=page_url |
| 610 | + image_file_id=result["file_name"], link=page_url |
610 | 611 | )
|
611 | 612 | sections.append(image_section)
|
612 | 613 | logger.info(
|
|
0 commit comments