feat: 优化PDF报告生成逻辑并添加调试脚本

移除对weasyprint_available的冗余检查,使用更高效的Count查询统计家庭事项
添加debug_pdf_email.py调试脚本用于直接测试PDF生成和邮件发送功能
This commit is contained in:
2026-01-19 23:24:04 +08:00
parent e3c9d6f17d
commit c22c001ee0
4 changed files with 286 additions and 4 deletions

View File

@@ -168,4 +168,21 @@
});
});
</script>
<div class="card mt-4">
<div class="card-header bg-info text-white">
<h5 class="card-title mb-0">历史PDF报告</h5>
</div>
<div class="card-body">
<div class="row">
{% for date in historical_dates %}
<div class="col-md-3 mb-2">
<a href="{% url 'generate_pdf_report' date|date:'Y-m-d' %}" class="btn btn-outline-primary btn-sm btn-block">
{{ date }} PDF
</a>
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock %}