-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: new "retired" field on policy models #386
Conversation
f9fd781
to
a403ebd
Compare
# The following policy should never be returned as it has redeemability disabled. | ||
PerLearnerEnrollmentCapLearnerCreditAccessPolicyFactory( | ||
enterprise_customer_uuid=self.enterprise_uuid, | ||
redeemability_disabled_at=datetime.utcnow() - timedelta(days=1), | ||
) |
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.
As discussed at standup on Friday, when redeemability is disabled (was: policy is "retired"), we should make the policy effectively disappear from a learner's perspective. I.e. it should not be returned by the credits_available endpoint, tested here.
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.
Looks good to me. I don't see any usages in the frontend for policy_is_active
so it looks like its safe to change it without any FE regressions.
ee2f5a0
to
e0bd1e3
Compare
Implements ADR 0016-policy-retirement, and also updates it to reflect the decision to rename the field to "retired" and change it to a boolean. Note this also adds extra visibility into the historical values of various policy fields via the django admin record history interface. Previously, changes were only noted (e.g. "active field changed"), but now the actual historical value of the field is visible. ENT-8206
e0bd1e3
to
a96819a
Compare
with the customer uuid requested by the client. | ||
""" | ||
return SubsidyAccessPolicy.objects.filter( | ||
return SubsidyAccessPolicy.policies_with_redemption_enabled().filter( |
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.
💯 nice
Implements ADR 0016-policy-retirement, and also updates it to reflect
the decision to rename the field to "retired" and change it to a
boolean.
Note this also adds extra visibility into the historical values of
various policy fields via the django admin record history interface.
Previously, changes were only noted (e.g. "active field changed"), but
now the actual historical value of the field is visible.
ENT-8206
Screenshots
What the checkboxes look like in django admin edit page for a policy.
Example of the history page for a policy that I changed to retired: