fix: correct applied_control 'impact' attribute for the csv export#3784
fix: correct applied_control 'impact' attribute for the csv export#3784martinzerty wants to merge 4 commits intomainfrom
Conversation
… the db called 'control_impact' in the csv export
📝 WalkthroughWalkthroughExported action-plan outputs now source the "Control impact" value from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
backend/core/views.py (1)
9714-9714: Correct CSV key fix; consider matching XLSX key usage too.Good fix—
control_impactmatches the serializer output and resolves the empty CSV “Impact” column.
For consistency, please also update Line 9757 inaction_plan_xlsx, which still readsitem.get("impact").Proposed parity change
- "impact": item.get("impact"), + "impact": item.get("control_impact"),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@backend/core/views.py` at line 9714, The CSV fix uses item.get("control_impact") to match the serializer; make the XLSX output consistent by changing the usage in the action_plan_xlsx logic from item.get("impact") to item.get("control_impact") so the "Impact" column in the Excel export shows the same value as the CSV/serializer; locate the action_plan_xlsx function in backend/core/views.py and replace the item.get("impact") occurrence with item.get("control_impact").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@backend/core/views.py`:
- Line 9714: The CSV fix uses item.get("control_impact") to match the
serializer; make the XLSX output consistent by changing the usage in the
action_plan_xlsx logic from item.get("impact") to item.get("control_impact") so
the "Impact" column in the Excel export shows the same value as the
CSV/serializer; locate the action_plan_xlsx function in backend/core/views.py
and replace the item.get("impact") occurrence with item.get("control_impact").
backend/core/views.py
Outdated
There was a problem hiding this comment.
We have the same issue here
There was a problem hiding this comment.
♻️ Duplicate comments (1)
backend/core/views.py (1)
6305-6305:⚠️ Potential issue | 🟡 MinorFix typo in action display name.
The
namestring has an accidental split word ("ac ceptances"), which leaks into API docs/UI metadata.✏️ Suggested fix
- `@action`(detail=False, name="Get ac ceptances to review") + `@action`(detail=False, name="Get acceptances to review")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@backend/core/views.py` at line 6305, Fix the typo in the action decorator's display name: update the `@action`(...) annotation that currently reads name="Get ac ceptances to review" so the name string is corrected to "Get acceptances to review" (locate the decorator on the view method where `@action`(detail=False, name=...) is declared) to remove the extra space and ensure API docs/UI show the proper label.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@backend/core/views.py`:
- Line 6305: Fix the typo in the action decorator's display name: update the
`@action`(...) annotation that currently reads name="Get ac ceptances to review"
so the name string is corrected to "Get acceptances to review" (locate the
decorator on the view method where `@action`(detail=False, name=...) is declared)
to remove the extra space and ensure API docs/UI show the proper label.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b6a95016-f479-418d-83a1-f839cf0ac41e
📒 Files selected for processing (2)
backend/core/views.pytools/convert_v1_to_v2.py
💤 Files with no reviewable changes (1)
- tools/convert_v1_to_v2.py
Replace 'impact' attribute of the applied controls by the one in the db called 'control_impact' in the csv export.
Before, we looked for the attribute named 'impact'. However, as it does not exist, the result for this attribute in the csv export was always empty
Summary by CodeRabbit