From 1173d17bb0c956ddea7f8aa27faa7bc175fd1dd3 Mon Sep 17 00:00:00 2001 From: michaelroytman Date: Fri, 7 Feb 2025 16:13:02 -0500 Subject: [PATCH] fix: clear all ProctoredExamSoftwareSecureReviewHistory instances of PII This commit changes the time at which we read instances of the ProctoredExamSoftwareSecureReviewHistory model. This is necessary because the act of saving the ProctoredExamSoftwareSecureReview model causes the pre-save instance to be saved to the ProctoredExamSoftwareSecureReviewHistory table. Because we read instances of the ProctoredExamSoftwareSecureReviewHistory model prior to calling save on the instances of the ProctoredExamSoftwareSecureReview model, we do not have the full queryset we need. Reading the instances of the ProctoredExamSoftwareSecureReviewHistory model from the database after we clear all the instances of the ProctoredExamSoftwareSecureReview model fixes this issue. --- CHANGELOG.rst | 4 ++++ edx_proctoring/__init__.py | 2 +- edx_proctoring/views.py | 3 +-- package.json | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4d83db614b..275793dfe8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,10 @@ Change Log Unreleased ~~~~~~~~~~ +[5.1.1] - 2025-02-07 +~~~~~~~~~~~~~~~~~~~~ +* fixes bug in ordering of query to ensure all Software Secure history is cleared of PII via the retirement endpoint + [5.1.0] - 2025-02-03 ~~~~~~~~~~~~~~~~~~~~ * add Software Secure review, history, and comment models to retirement endpoint diff --git a/edx_proctoring/__init__.py b/edx_proctoring/__init__.py index 9a8032e195..1939395192 100644 --- a/edx_proctoring/__init__.py +++ b/edx_proctoring/__init__.py @@ -3,4 +3,4 @@ """ # Be sure to update the version number in edx_proctoring/package.json -__version__ = '5.1.0' +__version__ = '5.1.1' diff --git a/edx_proctoring/views.py b/edx_proctoring/views.py index 8789c482d5..4781154ea0 100644 --- a/edx_proctoring/views.py +++ b/edx_proctoring/views.py @@ -2275,8 +2275,6 @@ def _retire_proctored_exam_software_secure_review_and_history_and_comment(self, # Retire reviews and review history. reviews = ProctoredExamSoftwareSecureReview.objects.filter(attempt_code=attempt_code) - review_history = ProctoredExamSoftwareSecureReviewHistory.objects.filter(attempt_code=attempt_code) - for review in reviews: review.encrypted_video_url = b'' review.raw_data = '' @@ -2285,6 +2283,7 @@ def _retire_proctored_exam_software_secure_review_and_history_and_comment(self, # and must save each review one-by-one. review.save() + review_history = ProctoredExamSoftwareSecureReviewHistory.objects.filter(attempt_code=attempt_code) for review in review_history: review.encrypted_video_url = b'' review.raw_data = '' diff --git a/package.json b/package.json index 54f3a28009..c572d06967 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@edx/edx-proctoring", "//": "Note that the version format is slightly different than that of the Python version when using prereleases.", - "version": "5.1.0", + "version": "5.1.1", "main": "edx_proctoring/static/index.js", "scripts": { "test": "gulp test"