Skip to content

Commit 64f7ec7

Browse files
committed
chore: remove deprecated ENTERPRISE_SUBSIDY_AUTOMATIC_EXTERNAL_CANCELLATION
This setting is True in all internal environments now.
1 parent ce225c5 commit 64f7ec7

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

enterprise_subsidy/apps/transaction/signals/handlers.py

-13
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,6 @@ def handle_lc_enrollment_revoked(**kwargs):
182182
f"Writing Reversal for Transaction: {related_transaction}."
183183
)
184184

185-
# On initial release we are only supporting learner initiated unenrollments for OCM courses.
186-
# OCM courses are identified by the lack of an external_reference on the Transaction object.
187-
# Externally referenced transactions can be unenrolled through the Django admin actions related to the
188-
# Transaction model.
189-
automatic_external_cancellation = getattr(settings, "ENTERPRISE_SUBSIDY_AUTOMATIC_EXTERNAL_CANCELLATION", False)
190-
if related_transaction.external_reference.exists() and not automatic_external_cancellation:
191-
logger.info(
192-
f"Found unenrolled enterprise fulfillment: {fulfillment_uuid} related to "
193-
f"an externally referenced transaction: {related_transaction.external_reference.first()}. "
194-
f"Skipping ENTERPRISE_SUBSIDY_AUTOMATIC_EXTERNAL_CANCELLATION={automatic_external_cancellation}."
195-
)
196-
return
197-
198185
# NOTE: get_content_metadata() is backed by TieredCache, so this would be performant if a bunch learners unenroll
199186
# from the same course at the same time. However, normally no two learners in the same course would unenroll within
200187
# a single cache timeout period, so we'd expect this to normally always re-fetch from remote API. That's OK because

enterprise_subsidy/apps/transaction/tests/test_signal_handlers.py

-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ def test_transaction_reversed_signal_without_fulfillment_identifier(
141141
@mock.patch('enterprise_subsidy.apps.transaction.signals.handlers.reverse_transaction')
142142
@mock.patch('enterprise_subsidy.apps.transaction.signals.handlers.unenrollment_can_be_refunded')
143143
@mock.patch('enterprise_subsidy.apps.transaction.signals.handlers.ContentMetadataApi.get_content_metadata')
144-
@override_settings(ENTERPRISE_SUBSIDY_AUTOMATIC_EXTERNAL_CANCELLATION=True)
145144
def test_handle_lc_enrollment_revoked(
146145
self,
147146
mock_get_content_metadata,

0 commit comments

Comments
 (0)