Skip to content

Conversation

@mateodurante
Copy link
Contributor

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:

  • Added a new route /networkadmin/exportevents and the corresponding ExportEventsForm component, allowing admins to request event exports by entering an email address. The form validates email input and displays success or error messages. [1] [2]
  • Updated translations in translation.json for 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:

  • Implemented event export logic in the Case model, including methods for exporting events to a directory and creating a ZIP archive of event data and evidence files.
  • Added a Celery task export_events_for_email_task to handle exporting events and sending the ZIP file via email, with support for attachments and improved summary communication. [1] [2] [3]
  • Created the ExportEventsSerializer for validating export requests and the ExportEventsViewSet for handling API requests to initiate event exports, including random delays to mitigate email enumeration attacks. [1] [2] [3] [4]
  • Registered the new API endpoint /api/export_events/ in the project URLs.

@mateodurante mateodurante changed the base branch from main to develop September 5, 2025 11:25
@mateodurante mateodurante merged commit 5c3b1ba into develop Sep 5, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants