-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: purge name from certificate records during learner retirement #34799
feat: purge name from certificate records during learner retirement #34799
Conversation
def _data_sharing_consent_assertions(self): | ||
""" | ||
Helper method for asserting that ``DataSharingConsent`` objects are retired. | ||
""" | ||
self.consent.refresh_from_db() | ||
assert self.retired_username == self.consent.username | ||
test_users_data_sharing_consent = DataSharingConsent.objects.filter( | ||
username=self.original_username | ||
) | ||
assert not test_users_data_sharing_consent.exists() | ||
|
||
def test_can_retire_users_sap_success_factors_audits(self): |
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.
Moved these verification functions to the top of the file. Generally, I get confused when helper and assertion functions are mixed in with all the tests.
I try to keep things like this:
- setUp/tearDown functions
- helper and assert/verification functions
- test cases
If y'all think I'm being too particular, let me know.
3c8bf14
to
d5561f9
Compare
lms/djangoapps/certificates/management/commands/purge_pii_from_generatedcertificates.py
Outdated
Show resolved
Hide resolved
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.
this looks nice. Almost all of my comments are nits about, well, comments. I'm pretty sure the only 2 substantive comments I have are to add a dry run because it would be so simple to, and to check on the efficiency of adding the other filter.
(like the Credentials IDA). | ||
|
||
This management command functions by requesting a list of learners' user_ids whom have completed their journey | ||
through the retirement pipeline. The `get_retired_user_ids` utility function is responsible for removing any |
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.
through the retirement pipeline. The `get_retired_user_ids` utility function is responsible for removing any | |
through the retirement pipeline. The `get_retired_user_ids` utility function is responsible for filtering out any |
because "removing" is ambiguous in this context.
lms/djangoapps/certificates/management/commands/purge_pii_from_generatedcertificates.py
Outdated
Show resolved
Hide resolved
...angoapps/certificates/management/commands/tests/test_purge_pii_from_generatedcertificates.py
Outdated
Show resolved
Hide resolved
...angoapps/certificates/management/commands/tests/test_purge_pii_from_generatedcertificates.py
Outdated
Show resolved
Hide resolved
...angoapps/certificates/management/commands/tests/test_purge_pii_from_generatedcertificates.py
Show resolved
Hide resolved
...angoapps/certificates/management/commands/tests/test_purge_pii_from_generatedcertificates.py
Show resolved
Hide resolved
openedx/core/djangoapps/user_api/accounts/tests/test_retirement_views.py
Outdated
Show resolved
Hide resolved
lms/djangoapps/certificates/management/commands/purge_pii_from_generatedcertificates.py
Outdated
Show resolved
Hide resolved
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
[APER-3241] This PR updates the retirement pipeline to purge learners' names from certificate records when their account is being retired. It also introduces a new management command that can be used by Open edX operators to purge the leftover name data (PII data) from the `certificates_generatedcertificate` table. This is designed as a one-time use data fixup, as the retirement functionality should clean this up now.
59de534
to
fd805e0
Compare
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
[APER-3241]
This PR updates the retirement pipeline to purge learners' names from certificate records when their account is being retired.
It also introduces a new management command that can be used by Open edX operators to purge the leftover name data (PII data) from the
certificates_generatedcertificate
table. This is designed as a one-time use data fixup, as the retirement functionality should clean this up now.