Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions dtable_events/automations/general_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,15 @@ def get_converted_row(self, table_id, row_id):
if not table:
logger.error('dtable: %s table: %s not found', self.dtable_uuid, table_id)
return None
sql = f"SELECT * FROM `{table['name']}` WHERE _id='{row_id}'"
try:
converted_row = self.dtable_server_api.get_row(table['name'], row_id, convert_link_id=True)
if not converted_row:
logger.error('dtable: %s table: %s row: %s not found or parse error', self.dtable_uuid, table_id, row_id)
return None
rows = self.dtable_db_api.query(sql, convert=True, server_only=True)[0]
except Exception as e:
logger.error('dtable: %s table: %s row: %s error: %s', self.dtable_uuid, table_id, row_id, e)
return None
if not rows:
return None
converted_row = rows[0]
return converted_row

def get_sql_row(self, table_id, row_id):
Expand Down
17 changes: 14 additions & 3 deletions dtable_events/dtable_io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from seaserv import seafile_api

from dtable_events.app.config import DTABLE_WEB_SERVICE_URL, INNER_DTABLE_SERVER_URL
from dtable_events.app.config import DTABLE_WEB_SERVICE_URL, INNER_DTABLE_SERVER_URL, INNER_DTABLE_DB_URL
from dtable_events.dtable_io.big_data import import_excel_to_db, update_excel_to_db, export_big_data_to_excel, \
export_app_table_page_to_excel
from dtable_events.dtable_io.utils import import_archive_from_src_dtable, post_big_data_screen_app_zip_file, \
Expand All @@ -36,6 +36,7 @@
from dtable_events.statistics.db import save_email_sending_records, batch_save_email_sending_records
from dtable_events.data_sync.data_sync_utils import run_sync_emails
from dtable_events.utils import is_valid_email, uuid_str_to_36_chars, gen_file_upload_url, uuid_str_to_32_chars
from dtable_events.utils.dtable_db_api import DTableDBAPI
from dtable_events.utils.dtable_server_api import DTableServerAPI, BaseExceedsException
from dtable_events.utils.dtable_web_api import DTableWebAPI
from dtable_events.utils.exception import ExcelFormatError
Expand Down Expand Up @@ -861,7 +862,12 @@ def send_notification_msg(emails, user_col_key, msg, dtable_uuid, username, tabl
if not table:
return

target_row = dtable_server_api.get_row(table['name'], row_id)
sql = f"SELECT * FROM `{table['name']}` WHERE _id='{row_id}'"
dtable_db_api = DTableDBAPI(username, dtable_uuid, INNER_DTABLE_DB_URL)
rows = dtable_db_api.query(sql, convert=True, server_only=True)[0]
if not rows:
return
target_row = rows[0]

sending_list = emails
if user_col_key:
Expand Down Expand Up @@ -1173,7 +1179,12 @@ def plugin_email_send_email(context):
dtable_server_api = DTableServerAPI(username, dtable_uuid, INNER_DTABLE_SERVER_URL, dtable_web_service_url=DTABLE_WEB_SERVICE_URL,
repo_id=repo_id, workspace_id=workspace_id)

replied_email_row = dtable_server_api.get_row(email_table_name, email_row_id)
sql = f"SELECT * FROM `{email_table_name}` WHERE _id='{email_row_id}'"
dtable_db_api = DTableDBAPI(username, dtable_uuid, INNER_DTABLE_DB_URL)
rows = dtable_db_api.query(sql, convert=True, server_only=True)[0]
if not rows:
return
replied_email_row = rows[0]

thread_id = replied_email_row.get('Thread ID')

Expand Down
Loading