feat: Add chartsheet warnings to error log for file processing

This commit is contained in:
Bobby Abellana (aider) 2025-02-18 09:42:39 -08:00
parent 99758f524e
commit ac58fbb15c

View File

@ -374,7 +374,9 @@ if input_method == "Upload Files" and uploaded_files and st.button("Process File
# Pass original filename to copy_excel_file # Pass original filename to copy_excel_file
chartsheet_warning = copy_excel_file(temp_input_path, temp_output_path, passwords, original_filename=uploaded_file.name) chartsheet_warning = copy_excel_file(temp_input_path, temp_output_path, passwords, original_filename=uploaded_file.name)
if chartsheet_warning: if chartsheet_warning:
st.warning(f"⚠️ {chartsheet_warning} Please check the processed file against the original to ensure data was copied correctly.") warning_msg = f"⚠️ {chartsheet_warning} Please check the processed file against the original to ensure data was copied correctly."
st.warning(warning_msg)
st.session_state.error_log[uploaded_file.name] = warning_msg
else: # Word else: # Word
remove_all_protection_tags(temp_input_path, temp_output_path) remove_all_protection_tags(temp_input_path, temp_output_path)
@ -460,7 +462,9 @@ elif input_method == "Select Directory" and source_dir and dest_dir and st.butto
if file_type == "Excel": if file_type == "Excel":
chartsheet_warning = copy_excel_file(source_path, dest_path, passwords) chartsheet_warning = copy_excel_file(source_path, dest_path, passwords)
if chartsheet_warning: if chartsheet_warning:
st.warning(f"⚠️ {chartsheet_warning} Please check the processed file against the original to ensure data was copied correctly.") warning_msg = f"⚠️ {chartsheet_warning} Please check the processed file against the original to ensure data was copied correctly."
st.warning(warning_msg)
st.session_state.error_log[relative_path] = warning_msg
else: # Word else: # Word
remove_all_protection_tags(source_path, dest_path) remove_all_protection_tags(source_path, dest_path)