Skip to content
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

Add ability to permanently delete submissions #2437

Merged
merged 8 commits into from
Jun 26, 2023

Conversation

KipSigei
Copy link
Contributor

@KipSigei KipSigei commented Jun 14, 2023

Changes / Features implemented

  • Add functionality to permanently delete submissions from db
  • Added feature flag ENABLE_SUBMISSION_PERMANENT_DELETE to optionally enable/disable the functionality

Steps taken to verify this change does what is intended

  • Tests

Side effects of implementing this change

Before submitting this PR for review, please make sure you have:

  • Included tests
  • Updated documentation

Closes #2431

@KipSigei KipSigei force-pushed the add-submissions-permanent-deletions-functionality branch 3 times, most recently from 6850bb5 to 3b374ac Compare June 14, 2023 16:12
if enable_submission_permanent_delete:
instance.delete()
else:
error_msg = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move this out of the loop else error_msg will be set for each instance

@KipSigei KipSigei force-pushed the add-submissions-permanent-deletions-functionality branch from 3b374ac to 4b14ce8 Compare June 19, 2023 12:36
kelvin-muchiri
kelvin-muchiri previously approved these changes Jun 19, 2023
@KipSigei KipSigei marked this pull request as ready for review June 19, 2023 13:45
@KipSigei KipSigei force-pushed the add-submissions-permanent-deletions-functionality branch from f7a218d to 6880703 Compare June 20, 2023 07:59
docs/data.rst Outdated Show resolved Hide resolved
kelvin-muchiri
kelvin-muchiri previously approved these changes Jun 20, 2023
@KipSigei KipSigei force-pushed the add-submissions-permanent-deletions-functionality branch 3 times, most recently from fed110e to 7ef972c Compare June 21, 2023 14:28
ukanga
ukanga previously approved these changes Jun 22, 2023
@KipSigei KipSigei force-pushed the add-submissions-permanent-deletions-functionality branch from 7ef972c to 0700dfc Compare June 22, 2023 08:00
docs/data.rst Outdated Show resolved Hide resolved
@KipSigei KipSigei force-pushed the add-submissions-permanent-deletions-functionality branch from 0700dfc to 49055c3 Compare June 22, 2023 08:45
Signed-off-by: Kipchirchir Sigei <[email protected]>
Signed-off-by: Kipchirchir Sigei <[email protected]>
Signed-off-by: Kipchirchir Sigei <[email protected]>
Signed-off-by: Kipchirchir Sigei <[email protected]>
Signed-off-by: Kipchirchir Sigei <[email protected]>
Signed-off-by: Kipchirchir Sigei <[email protected]>
@KipSigei KipSigei force-pushed the add-submissions-permanent-deletions-functionality branch from 49055c3 to 7734634 Compare June 26, 2023 05:52
self.assertEqual(self.xform.instances.count(), 3)
self.assertEqual(self.xform.num_of_submissions, 3)

@override_settings(ENABLE_SUBMISSION_PERMANENT_DELETE=True)
Copy link
Contributor

@kelvin-muchiri kelvin-muchiri Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add to the documentation what setting ENABLE_SUBMISSION_PERMANENT_DELETE is used for and its side effects

Signed-off-by: Kipchirchir Sigei <[email protected]>
@KipSigei KipSigei force-pushed the add-submissions-permanent-deletions-functionality branch from 7734634 to f929305 Compare June 26, 2023 08:07
@KipSigei KipSigei requested a review from ukanga June 26, 2023 08:33
@KipSigei KipSigei merged commit cb6f9d1 into main Jun 26, 2023
7 of 8 checks passed
@KipSigei KipSigei deleted the add-submissions-permanent-deletions-functionality branch June 26, 2023 10:13
@KipSigei KipSigei mentioned this pull request Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate Permanent Deletions for Submissions after specified period
3 participants