Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 5.2.12 on 2026-06-24 18:33

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('subsidy_access_policy', '0030_mariadb_uuid_conversion'),
]

operations = [
migrations.AlterField(
model_name='historicalsubsidyaccesspolicy',
name='active',
field=models.BooleanField(default=False, help_text='Set to FALSE to deactivate this policy, and hide it from both admins and learners. Use this when you want to effectively soft-delete this policy. A typical use case is that the policy was created on accident or as a test. Caveat: you cannot deactivate a policy with existing spend/enrollments.'),
Comment thread
pwnage101 marked this conversation as resolved.
),
migrations.AlterField(
model_name='historicalsubsidyaccesspolicy',
name='retired',
field=models.BooleanField(default=False, help_text="Set to TRUE to deactivate this policy, but NOT hide it from admins. Use this when you want to disable redemption, but you can't set active=False because this policy already has spend/enrollments."),
Comment thread
pwnage101 marked this conversation as resolved.
),
migrations.AlterField(
model_name='subsidyaccesspolicy',
name='active',
field=models.BooleanField(default=False, help_text='Set to FALSE to deactivate this policy, and hide it from both admins and learners. Use this when you want to effectively soft-delete this policy. A typical use case is that the policy was created on accident or as a test. Caveat: you cannot deactivate a policy with existing spend/enrollments.'),
Comment thread
pwnage101 marked this conversation as resolved.
),
migrations.AlterField(
model_name='subsidyaccesspolicy',
name='retired',
field=models.BooleanField(default=False, help_text="Set to TRUE to deactivate this policy, but NOT hide it from admins. Use this when you want to disable redemption, but you can't set active=False because this policy already has spend/enrollments."),
Comment thread
pwnage101 marked this conversation as resolved.
),
]
24 changes: 12 additions & 12 deletions enterprise_access/apps/subsidy_access_policy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,23 +181,16 @@ class Meta:
active = models.BooleanField(
default=False,
help_text=(
'Set to FALSE to deactivate and hide this policy. Use this when you want to disable redemption and make '
'it disappear from all frontends, effectively soft-deleting it. Default is False (deactivated).'
'Set to FALSE to deactivate this policy, and hide it from both admins and learners. Use this when you '
'want to effectively soft-delete this policy. A typical use case is that the policy was created on '
'accident or as a test. Caveat: you cannot deactivate a policy with existing spend/enrollments.'
Comment thread
pwnage101 marked this conversation as resolved.
),
)
learner_credit_request_config = models.OneToOneField(
'subsidy_request.LearnerCreditRequestConfiguration',
related_name="learner_credit_config",
on_delete=models.SET_NULL,
null=True,
blank=True,
)
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 "
"(useful when you want to just expire a policy without expiring the whole plan)."
"Set to TRUE to deactivate this policy, but NOT hide it from admins. Use this when you want to disable "
"redemption, but you can't set active=False because this policy already has spend/enrollments."
Comment thread
pwnage101 marked this conversation as resolved.
),
)
retired_at = models.DateTimeField(
Expand All @@ -207,6 +200,13 @@ class Meta:
"The date and time when this policy is considered retired."
)
)
learner_credit_request_config = models.OneToOneField(
'subsidy_request.LearnerCreditRequestConfiguration',
related_name="learner_credit_config",
on_delete=models.SET_NULL,
null=True,
blank=True,
)
catalog_uuid = models.UUIDField(
db_index=True,
help_text='The primary identifier of the catalog associated with this policy.',
Expand Down
Loading