fix: allow admins to downoad all reports - #78
Conversation
- This also changes non-ready report response to error 403 instead of 404
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label
|
|||||||||||||||||||||||||
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label
|
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
User description
Description
PR Type
Bug fix, Enhancement
Description
Allow admins to download all reports, not just their own
Change non-ready report error from 404 to 403
Make download_report endpoint async for better performance
Diagram Walkthrough
flowchart LR A["Download Report Request"] --> B{"Is Admin?"} B -->|Yes| C["Allow Download"] B -->|No| D{"Owner Check"} D -->|Pass| E{"Report Ready?"} D -->|Fail| F["403 Forbidden"] E -->|Yes| C E -->|No| G["403 Forbidden"] C --> H["Stream CSV File"]File Walkthrough
reports.py
Admin report download and error code fixesbackend/api/routers/reports.py
download_reportfunction to be async