-
Notifications
You must be signed in to change notification settings - Fork 6
Add POST identification task review #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #318 +/- ##
==========================================
+ Coverage 50.66% 50.68% +0.01%
==========================================
Files 72 72
Lines 10449 10453 +4
==========================================
+ Hits 5294 5298 +4
Misses 5155 5155 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a POST identification task review feature that allows users with appropriate permissions to review identification tasks by either agreeing with the current classification or overwriting it with a new classification.
- Add review permission handling in the permission system
- Add new API endpoint for creating identification task reviews with two types: agree and overwrite
- Add comprehensive test coverage for the review functionality
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tigacrafting/permissions.py | Add ReviewPermission model support to role permission system |
| tigacrafting/managers.py | Update IdentificationTask queryset to include review permissions for browsable filtering |
| api/views.py | Add review endpoint with polymorphic serializer support for agree/overwrite actions |
| api/tests/test_views.py | Add unit tests for both agree and overwrite review functionality |
| api/tests/integration/identification_tasks/review/schema.yml | Add schema validation for integration tests |
| api/tests/integration/identification_tasks/review/create.tavern.yml | Add integration tests for review endpoint permissions and functionality |
| api/tests/integration/identification_tasks/review/conftest.py | Add test fixtures for review integration tests |
| api/serializers.py | Add serializers for review operations and update IdentificationTaskSerializer field names |
| api/permissions.py | Add IdentificationTaskReviewPermissions class for review endpoint authorization |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| def validate(self, data): | ||
| data = super().validate(data) | ||
|
|
||
| # Case Not an insect will be empty taxon. In case of update we need to for it to None |
Copilot
AI
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar error in comment: 'we need to for it to None' should be 'we need to force it to None'.
| # Case Not an insect will be empty taxon. In case of update we need to for it to None | |
| # Case Not an insect will be empty taxon. In case of update we need to force it to None |
api/serializers.py
Outdated
| try: | ||
| data['best_photo'] = Photo.objects.get(report=data['report'], uuid=public_photo_uuid) | ||
| except Photo.DoesNotExist: | ||
| raise serializers.ValidationError("The photo does not does not exist or does not belong to the observation.") |
Copilot
AI
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate word in error message: 'does not does not exist' should be 'does not exist'.
| raise serializers.ValidationError("The photo does not does not exist or does not belong to the observation.") | |
| raise serializers.ValidationError("The photo does not exist or does not belong to the observation.") |
No description provided.