fix: make active and retired fields clearer (SubsidyAccessPolicy)#214
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the admin-facing help_text for the SubsidyAccessPolicy.retired flag to correct the described boolean polarity and keep the schema’s field metadata in sync via a migration.
Changes:
- Updates
SubsidyAccessPolicy.retiredhelp text to reflect the intended meaning of theretiredflag. - Adds a Django migration to update the
retiredfield help text for bothSubsidyAccessPolicyand its historical model.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
enterprise_access/apps/subsidy_access_policy/models.py |
Adjusts the retired field’s help_text shown in admin/forms. |
enterprise_access/apps/subsidy_access_policy/migrations/0031_fix_subsidyaccesspolicy_retired_helptext.py |
Applies the help text update at the DB schema metadata level for both current and historical models. |
| retired = models.BooleanField( | ||
| default=False, | ||
| help_text=( | ||
| "True means redeemability of content using this policy has been enabled. " | ||
| "Set this to False to deactivate the policy but keep it visible from an admin's perspective " | ||
| "False means redeemability of content using this policy has been enabled. " | ||
| "Set this to True to deactivate the policy but keep it visible from an admin's perspective " | ||
| "(useful when you want to just expire a policy without expiring the whole plan)." |
There was a problem hiding this comment.
Is this feedback from co-pilot true?
| migrations.AlterField( | ||
| model_name='historicalsubsidyaccesspolicy', | ||
| name='retired', | ||
| field=models.BooleanField(default=False, help_text="False means redeemability of content using this policy has been enabled. Set this to True to deactivate the policy but keep it visible from an admin's perspective (useful when you want to just expire a policy without expiring the whole plan)."), |
| migrations.AlterField( | ||
| model_name='subsidyaccesspolicy', | ||
| name='retired', | ||
| field=models.BooleanField(default=False, help_text="False means redeemability of content using this policy has been enabled. Set this to True to deactivate the policy but keep it visible from an admin's perspective (useful when you want to just expire a policy without expiring the whole plan)."), |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #214 +/- ##
=======================================
Coverage 86.44% 86.44%
=======================================
Files 154 154
Lines 12848 12848
Branches 1227 1227
=======================================
Hits 11107 11107
Misses 1426 1426
Partials 315 315 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
brobro10000
left a comment
There was a problem hiding this comment.
Approved to unblock. Only 1 copilot to double check on.
| retired = models.BooleanField( | ||
| default=False, | ||
| help_text=( | ||
| "True means redeemability of content using this policy has been enabled. " | ||
| "Set this to False to deactivate the policy but keep it visible from an admin's perspective " | ||
| "False means redeemability of content using this policy has been enabled. " | ||
| "Set this to True to deactivate the policy but keep it visible from an admin's perspective " | ||
| "(useful when you want to just expire a policy without expiring the whole plan)." |
There was a problem hiding this comment.
Is this feedback from co-pilot true?
f61feae to
ae65a3b
Compare
retired field (SubsidyAccessPolicy)active and retired fields clearer (SubsidyAccessPolicy)
No description provided.