Coverage for src/backend/InvenTree/data_exporter/apps.py: 92%
13 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 17:47 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 17:47 +0000
1"""Config options for the exporter app."""
3from django.apps import AppConfig
6class DataExporterConfig(AppConfig):
7 """Configuration class for the 'exporter' app."""
9 default_auto_field = 'django.db.models.BigAutoField'
10 name = 'data_exporter'
12 def ready(self):
13 """Run any code that needs to be executed when the app is loaded."""
14 super().ready()
16 self.cleanup()
18 def cleanup(self):
19 """Cleanup any old export files."""
20 try:
21 from data_exporter.tasks import cleanup_old_export_outputs # type: ignore
23 cleanup_old_export_outputs()
24 except Exception:
25 pass