-
Notifications
You must be signed in to change notification settings - Fork 26
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
Enable exporting (registered) submission metadata #4962
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4962 +/- ##
==========================================
+ Coverage 96.62% 96.63% +0.01%
==========================================
Files 760 762 +2
Lines 25837 25925 +88
Branches 3385 3389 +4
==========================================
+ Hits 24964 25052 +88
Misses 608 608
Partials 265 265 ☔ View full report in Codecov by Sentry. |
Export submission statistics based on the timeline logs. Note: if the timeline logs are pruned, this affects the exports. It's up to the users to periodically create these exports and save them somewhere if they periodically prune log records. Note 2: filtering on forms only works on new log records, as existing log records don't have the form ID stored in the structured data. Submissions that were deleted for which existing log records are present will display 'unknown' for some columns because the relevant information has been deleted. Only from 3.0 onwards are we snapshotting the data required for the exports.
Ensures that the filters are correctly implemented.
end_date: date = form.cleaned_data["end_date"] | ||
dataset = form.export() | ||
format = XLSX() | ||
filename = f"submissions_{start_date.isoformat()}_{end_date.isoformat()}.xlsx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to add the form names, if the limit is used
def export(self) -> Dataset: | ||
start_date: date = self.cleaned_data["start_date"] | ||
end_date: date = self.cleaned_data["end_date"] | ||
return export_registration_statistics( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a bit picky, but why do you define the dates as variables? Is it (only) to specify the date typing?
Otherwise, why not just pass the cleaned_data
directly?
@@ -34,7 +34,7 @@ def export_registration_statistics( | |||
) | |||
|
|||
_start_date = make_aware(datetime.combine(start_date, time.min)) | |||
_end_date = make_aware(datetime.combine(end_date, time.max)) | |||
_end_date = make_aware(datetime.combine(end_date, time.min)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not till the end of the day?
I've tried the export, and was missing some submissions.. I'm not yet sure why, i'll take another look later today.. |
Closes #4930
Changes
Checklist
Check off the items that are completed or not relevant.
Impact on features
Release management
I have updated the translations assets (you do NOT need to provide translations)
./bin/makemessages_js.sh
./bin/compilemessages_js.sh
Dockerfile/scripts
./bin
folderCommit hygiene