Skip to content

Commit 46bfe1e

Browse files
author
Sage Sharp
committed
Make essay removal completely manual
Keep essays of people who organizer mark their applications for rejection. When reviewing initial applications, I have accidentally hit the 'reject application' button when I meant to click another button. That means the essay is automatically purged from our database, and that application essay is lost. Instead, make purging essays a manual process that is done once all applications have been reviewed and finalized. Update the test to manually remove sensitive information for rejected applications as well as approved applications.
1 parent ad89626 commit 46bfe1e

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

home/test_privacy_initial_application_sensitive_data.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,16 @@ def test_sensitive_data_removed_on_processing(self):
257257

258258
if approval_status == models.ApprovalStatus.APPROVED:
259259
response = self.client.post(applicant_approval.get_approve_url())
260-
# Reload the object from the database after the invoked view modifies the database
261-
applicant_approval = models.ApplicantApproval.objects.get(pk=applicant_approval.pk)
262-
263-
# Manually collect statistics and purge essay
264-
applicant_approval.collect_statistics()
265-
applicant_approval.purge_sensitive_data()
266260
elif approval_status == models.ApprovalStatus.REJECTED:
267261
response = self.client.post(applicant_approval.get_reject_url())
268262

263+
# Reload the object from the database after the invoked view modifies the database
264+
applicant_approval = models.ApplicantApproval.objects.get(pk=applicant_approval.pk)
265+
266+
# Manually collect statistics and purge essay
267+
applicant_approval.collect_statistics()
268+
applicant_approval.purge_sensitive_data()
269+
269270
self.assertRedirects(response, applicant_approval.get_preview_url())
270271

271272
# Reload the object from the database after the invoked view modifies the database

home/views.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -4072,17 +4072,8 @@ def get_object(self):
40724072
application_round=current_round)
40734073

40744074
def get_success_url(self):
4075-
# If the ApplicantApproval was just rejected
4076-
# collect aggregate anonymized statistics and delete:
4077-
# - essay answers
4078-
# - gender identity data
4079-
# - race and ethnicity demographics
4080-
if self.object.approval_status == ApprovalStatus.REJECTED:
4081-
self.object.collect_statistics()
4082-
self.object.purge_sensitive_data()
4083-
40844075
# Outreachy organizers will manually collect statistics
4085-
# and purge essays of approved applications
4076+
# and purge application essays and sensitive information
40864077

40874078
return self.object.get_preview_url()
40884079

0 commit comments

Comments
 (0)