pyronear / pyro-api

Alert Management API for wildfire prevention, detection & monitoring. Built with FastAPI & PostgreSQL
Apache License 2.0
21 stars 9 forks source link

Fix fetch unlabeled detections endpoint #366

Closed RonanMorgan closed 1 week ago

RonanMorgan commented 2 months ago

When calling the fetch unlabeled detections endpoint with an ADMIN token, the pictures were not found in the S3 because the organisation_id of ADMIN is = 1, while we would like to get all the Detection of all the organization.

So for ADMIN token we should find the organization_id thanks to the Camera.detection_id

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 70.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 84.83%. Comparing base (f737b0d) to head (982c194). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/app/api/api_v1/endpoints/detections.py 80.00% 3 Missing :warning:
src/app/crud/base.py 50.00% 2 Missing :warning:
src/app/api/dependencies.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #366 +/- ## ========================================== - Coverage 85.51% 84.83% -0.68% ========================================== Files 35 35 Lines 987 996 +9 ========================================== + Hits 844 845 +1 - Misses 143 151 +8 ``` | [Flag](https://app.codecov.io/gh/pyronear/pyro-api/pull/366/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyronear) | Coverage Δ | | |---|---|---| | [backend](https://app.codecov.io/gh/pyronear/pyro-api/pull/366/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyronear) | `84.35% <70.00%> (-0.72%)` | :arrow_down: | | [client](https://app.codecov.io/gh/pyronear/pyro-api/pull/366/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyronear) | `92.06% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyronear#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.