Conversation
✅ Deploy Preview for ami-dev canceled.
|
mihow
left a comment
There was a problem hiding this comment.
Fantastic! Great job finding the appropriate place for these changes and thank you for all of the tests.
Do you feel up to making the changes on the frontend as well? Perhaps doing a pair session with Anna? If we merge it before the frontend is updated, then we have to make the change backwards compatible, which is cool but adds some mess to clean up later.
ami/main/api/views.py
Outdated
| } | ||
| ) | ||
|
|
||
| @extend_schema( |
There was a problem hiding this comment.
Awesome that you discovered how to customize the auto-generated docs! I will be copying this approach to other places.
|
Done with the frontend part! @mihow Should we identify all the places in the backend code where we should change the |
| # Test that occurrences are specific to each project | ||
| for project in [self.project_one, self.project_two]: | ||
| response = self.client.get(f"/api/v2/occurrences/?project={project.pk}") | ||
| response = self.client.get(f"/api/v2/occurrences/?project_id={project.pk}") |
There was a problem hiding this comment.
Nice work tracking down all the existing uses!!!
| # request = self.context.get("request") | ||
| # project_id = request.query_params.get("project") if request else None | ||
| project_id = self.context["request"].query_params["project"] | ||
| project_id = self.context["request"].query_params["project_id"] |
There was a problem hiding this comment.
Thanks for finding this. When we optimize the Taxa view, I think we will be able to remove this function.
| filter_active = any([occurrence_id, project, deployment_id, event_id, collection_id]) | ||
|
|
||
| if not project_id: | ||
| if not project: |
There was a problem hiding this comment.
@mohamedelabbas1996 in #402 I think we will require a project for all calls. Let's talk about this. We could require the project ID in the URL.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
|
Almost one year since @mohamedelabbas1996 first PR! 🌟 |
Closes #660