fix: Report backend adjustments
Supporting information
Why
- Some adjustments needed to be made for report generation API working properly
Changes
- Allow compare runs of inactive recurrences (test included)
- Fix the issue fetching CSV report of empty recurrence with checklist that has numeric task definition (test included)
- Add a management command to allow admin user to trigger creating and recomputing trends report manually (test included)
Testing instruction
- Create checklist that has one or numeric tasks
- Create recurrence for created checklist
- Call API to get recurrence trends report in CSV format -- Expected behavior: No error returned (500), empty CSV responded
- Configure to generate some recurrence runs
- Deactivate recurrence and call compare API with a date range -- Expected behavior: List of run responded properly
- Navigate to Admin > Workflow > Recurrence trend task reports
- Delete all trends report of the recurrence
- Run command to trigger creating and computing trends report for recurrence
python manage.py create_and_compute_trends_report --recurrence_id <recurrence_id>
- Check Recurrence trend task reports instances in the admin UI again -- Expected behavior: Trends reports of all task definitions are created for the recurrence and data is computed properly
PoW
Edited by Dat Nguyen