Skip to content

Commit ec29480

Browse files
committed
fix: remove nonfunctional retirement methods and driver references
1 parent e2cd3df commit ec29480

2 files changed

Lines changed: 0 additions & 47 deletions

File tree

scripts/user_retirement/retire_one_learner.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
ecommerce: http://localhost:18130/
1212
credentials: http://localhost:18150/
1313
retirement_pipeline:
14-
- ['RETIRING_CREDENTIALS', 'CREDENTIALS_COMPLETE', 'CREDENTIALS', 'retire_learner']
15-
- ['RETIRING_ECOM', 'ECOM_COMPLETE', 'ECOMMERCE', 'retire_learner']
1614
- ['RETIRING_LICENSE_MANAGER', 'LICENSE_MANAGER_COMPLETE', 'LICENSE_MANAGER', 'retire_learner']
1715
- ['RETIRING_FORUMS', 'FORUMS_COMPLETE', 'LMS', 'retirement_retire_forum']
1816
- ['RETIRING_EMAIL_LISTS', 'EMAIL_LISTS_COMPLETE', 'LMS', 'retirement_retire_mailings']
@@ -129,21 +127,6 @@ def _get_learner_and_state_index_or_exit(config, username):
129127
FAIL_EXCEPTION(ERR_SETUP_FAILED, 'Unexpected error fetching user state!', str(exc))
130128

131129

132-
def _get_ecom_segment_id(config, learner):
133-
"""
134-
Calls Ecommerce to get the ecom-specific Segment tracking id that we need to retire.
135-
This is only available from Ecommerce, unfortunately, and makes more sense to handle
136-
here than to pass all of the config down to SegmentApi.
137-
"""
138-
try:
139-
return config['ECOMMERCE'].get_tracking_key(learner)
140-
except HttpDoesNotExistException:
141-
LOG('Learner {} not found in Ecommerce. Setting Ecommerce Segment ID to None'.format(learner)) # noqa: UP032
142-
return None
143-
except Exception as exc: # pylint: disable=broad-except
144-
FAIL_EXCEPTION(ERR_SETUP_FAILED, 'Unexpected error fetching Ecommerce tracking id!', str(exc))
145-
146-
147130
@click.command("retire_learner")
148131
@click.option(
149132
'--username',
@@ -172,9 +155,6 @@ def retire_learner(
172155

173156
learner, learner_state_index = _get_learner_and_state_index_or_exit(config, username)
174157

175-
if config.get('fetch_ecommerce_segment_id', False):
176-
learner['ecommerce_segment_id'] = _get_ecom_segment_id(config, learner)
177-
178158
start_state = None
179159
try:
180160
for start_state, end_state, service, method in config['retirement_pipeline']:

scripts/user_retirement/utils/edx_api.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -398,24 +398,6 @@ class EcommerceApi(BaseApiClient):
398398
Ecommerce API client with convenience methods for making API calls.
399399
"""
400400

401-
@_retry_lms_api()
402-
def retire_learner(self, learner):
403-
"""
404-
Performs the learner retirement step for Ecommerce
405-
"""
406-
data = {"username": learner["original_username"]}
407-
api_url = self.get_api_url("api/v2/user/retire")
408-
return self._request("POST", api_url, json=data)
409-
410-
@_retry_lms_api()
411-
def get_tracking_key(self, learner):
412-
"""
413-
Fetches the ecommerce tracking id used for Segment tracking when
414-
ecommerce doesn't have access to the LMS user id.
415-
"""
416-
api_url = self.get_api_url(f"api/v2/retirement/tracking_id/{learner['original_username']}")
417-
return self._request("GET", api_url)["ecommerce_tracking_id"]
418-
419401
def replace_usernames(self, username_mappings):
420402
"""
421403
Calls the ecommerce API to replace usernames.
@@ -434,15 +416,6 @@ class CredentialsApi(BaseApiClient):
434416
Credentials API client with convenience methods for making API calls.
435417
"""
436418

437-
@_retry_lms_api()
438-
def retire_learner(self, learner):
439-
"""
440-
Performs the learner retirement step for Credentials
441-
"""
442-
data = {"username": learner["original_username"]}
443-
api_url = self.get_api_url("user/retire")
444-
return self._request("POST", api_url, json=data)
445-
446419
def replace_usernames(self, username_mappings):
447420
"""
448421
Calls the credentials API to replace usernames.

0 commit comments

Comments
 (0)