Skip to content

[Bug] ModuleNotFoundError: No module named 'database' in backend/export.py #37

@nidhi808

Description

@nidhi808

Bug Description

The backend application crashes or raises a ModuleNotFoundError when hitting the /export endpoint or when importing the export router. This happens because backend/export.py contains a bare/relative import on line 6:

from database import get_connection

Steps to Reproduce

  1. Start the FastAPI server using uvicorn backend.main:app or standard start scripts.
  2. Trigger the export endpoint via: curl http://localhost:8000/api/emails/export?format=csv
  3. Look at the traceback, it will fail with: ModuleNotFoundError: No module named 'database'

Suggested Fix

Change the import on line 6 of backend/export.py

Acceptance Criteria

  1. Import in backend/export.py is corrected to from backend.database import get_connection
  2. No ModuleNotFoundError is raised when starting the server or hitting /api/emails/export.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions