mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-01 20:03:30 +02:00
fix: remove duplicate footers in report generation and ensure single standard disclaimer is appended
This commit is contained in:
parent
b426653dfb
commit
f7bbce098b
1 changed files with 8 additions and 1 deletions
|
|
@ -968,7 +968,14 @@ def create_generate_report_tool(
|
|||
"title": topic,
|
||||
}
|
||||
|
||||
# Append standard disclaimer to every report
|
||||
# Strip any existing footer(s) carried over from parent version(s)
|
||||
while report_content.rstrip().endswith(_REPORT_FOOTER):
|
||||
idx = report_content.rstrip().rfind(_REPORT_FOOTER)
|
||||
report_content = report_content[:idx].rstrip()
|
||||
if report_content.rstrip().endswith("---"):
|
||||
report_content = report_content.rstrip()[:-3].rstrip()
|
||||
|
||||
# Append exactly one standard disclaimer
|
||||
report_content += "\n\n---\n\n" + _REPORT_FOOTER
|
||||
|
||||
# Extract metadata (includes "status": "ready")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue