Export events to email #234
Merged
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.
This pull request introduces a new feature that enables administrators to export events and send the exported data to a specified email address. The changes span the frontend and backend, adding a user interface for initiating exports, API endpoints and background task handling for the export process, and supporting translations in English and Spanish. Additionally, error handling and messaging are improved to provide clearer feedback to users.
Frontend changes:
/networkadmin/exporteventsand the correspondingExportEventsFormcomponent, allowing admins to request event exports by entering an email address. The form validates email input and displays success or error messages. [1] [2]translation.jsonfor both English and Spanish, including new strings for the export events feature and improved error messaging and email placeholders. [1] [2] [3] [4]Backend changes:
Casemodel, including methods for exporting events to a directory and creating a ZIP archive of event data and evidence files.export_events_for_email_taskto handle exporting events and sending the ZIP file via email, with support for attachments and improved summary communication. [1] [2] [3]ExportEventsSerializerfor validating export requests and theExportEventsViewSetfor handling API requests to initiate event exports, including random delays to mitigate email enumeration attacks. [1] [2] [3] [4]/api/export_events/in the project URLs.