-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix scheduled Aggregate Report naming #3748
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ammar92
reviewed
Oct 29, 2024
Rieven
reviewed
Oct 29, 2024
9 tasks
Checklist for QA:
What works:Looks good, the bug is indeed fixed now. What doesn't work:n/a Bug or feature?:
The following screenshot to elaborate both above points: |
Quality Gate failedFailed conditions |
underdarknl
approved these changes
Nov 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: This PR uses the code of PR #3726
Changes
This PR fixes the bug where a scheduled Aggregate Report would always be generated with the name "Concatenated Report".
I've moved the "save_report" function out of SaveAggregateReportMixin and called it "save_aggregate_report_data". This way, it's possible to access the data from outside of the class.
I've given the SaveAggregateReportView a "report_type = AggregateOrganisationReport" and I've given the ReportRecipe model a "parent_report_type". This parent_report_type can be "concatinated-report", "aggregated-report" or None (for a single report).
Then in the ReportRunner it checks if the parent_report_type of the ReportRecipe is an Aggregate Report. If it is, it does a save_aggregate_report_data, else it does a save_report_data (for single or concatenated reports).
Issue link
Closes #3725
Demo
These schedules:
Result in:
QA notes
Code Checklist
.env
changes files if required and changed the.env-dist
accordingly.Checklist for code reviewers:
Copy-paste the checklist from the docs/source/templates folder into your comment.
Checklist for QA:
Copy-paste the checklist from the docs/source/templates folder into your comment.