fix: minor fixes

This commit is contained in:
Christopher Gondek 2025-09-05 15:26:33 +02:00
parent b4481dc92f
commit 4b9b805632
2 changed files with 8 additions and 9 deletions

View file

@ -152,8 +152,7 @@ class ConnectorSharepoint:
bool: True if successful, False otherwise bool: True if successful, False otherwise
""" """
target_folder = self.ctx.web.get_folder_by_server_relative_url(folder_path) target_folder = self.ctx.web.get_folder_by_server_relative_url(folder_path)
buffer = BytesIO(content) target_folder.upload_file(file_name, content).execute_query()
target_folder.files.upload(buffer, file_name).execute_query()
return True return True
async def overwrite_file_async( async def overwrite_file_async(

View file

@ -1,5 +1,5 @@
from dataclasses import dataclass from dataclasses import dataclass
from io import BytesIO from io import BytesIO, StringIO
from typing import Any from typing import Any
import pandas as pd import pandas as pd
from modules.shared.timezoneUtils import get_utc_now from modules.shared.timezoneUtils import get_utc_now
@ -251,8 +251,8 @@ class TicketSharepointSyncInterface:
"" if jira_value is None else str(jira_value).strip() "" if jira_value is None else str(jira_value).strip()
) )
# Only include if values are different and CSV has non-empty value # Include if values are different (allow empty strings to clear fields like the reference does)
if csv_value != jira_value and csv_value: if csv_value != jira_value:
task_changes[field_name] = csv_value task_changes[field_name] = csv_value
if task_changes: if task_changes:
@ -538,7 +538,7 @@ class TicketSharepointSyncInterface:
[header_row1, header_row2, table_headers, df], ignore_index=True [header_row1, header_row2, table_headers, df], ignore_index=True
) )
# Convert to CSV bytes # Convert to CSV bytes (write text, then encode)
csv_buffer = BytesIO() csv_text = StringIO()
final_df.to_csv(csv_buffer, index=False, header=False) final_df.to_csv(csv_text, index=False, header=False)
return csv_buffer.getvalue() return csv_text.getvalue().encode("utf-8")