`/api/api/admin/media_report.py, line 387, in change_view` can fail if the tag does not have a provider
sarayourfriend opened this issue · comments
Description
This line fails for tags without a provider
openverse/api/api/admin/media_report.py
Line 387 in 7e558ef
You cannot visit http://localhost:50280/admin/api/image//change/ because of this.
Reproduction
- Run the API and `just api/init`
- create a report for image 69dd41c2-beac-4640-baa5-8956a74bcd0f
- Visit the admin API image view for that image and see the crash
To fix this, change the linked line above to tag.get("provider")
and correctly handle the None case.
Additional context
Found while reviewing #4415 but is unrelated to that PR.
This also seems like an underlying data consistency issue we should address 😅 I (clearly inaccurately) made the assumption that all tag values have a provider associated with them, and I think they should (or at least default to the record's provider).
@AetherUnbound would you like to keep this open to track the fixes towards the underlying data inconsistency?
I'll make a new issue for it today!