-
Notifications
You must be signed in to change notification settings - Fork 133
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 task to permanently delete soft-deleted submissions #2446
Conversation
6bbaf9a
to
653c14d
Compare
653c14d
to
0e8ae54
Compare
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.
Should we also check that the records have been removed from the InstanceHistory?
Also, could we verify attachments have been removed from storage locations?
onadata/apps/api/tasks.py
Outdated
""" | ||
Task to periodically delete soft deleted submissions from db | ||
""" | ||
submissions_lifespan = getattr(settings, "INACTIVE_SUBMISSIONS_LIFESPAN", 365) |
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 line seems to define a hard limit of 365 days if the setting does not exist. Could we take the option of simply not taking any action if the setting is not defined/set? That will maintain the status quo as is now instead of on deployment all deleted items older than a year being removed. For some installations, this may not be ideal and prior communication may be necessary.
7165fe6
to
d253557
Compare
d253557
to
a79d95a
Compare
278b05b
to
df6a028
Compare
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]>
df6a028
to
86055b4
Compare
onadata/apps/api/tasks.py
Outdated
Q(deleted_at__isnull=False) | Q(deleted_at__gte=time_threshold), | ||
date_created__lte=time_threshold, |
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.
Should this check be based only on the time since the record was last deleted hence using the deleted_at
field for checks and not when the record was created?
Signed-off-by: Kipchirchir Sigei <[email protected]>
82055d3
to
d172194
Compare
d172194
to
713b55a
Compare
Signed-off-by: Kipchirchir Sigei <[email protected]>
713b55a
to
00fe783
Compare
Changes / Features implemented
Steps taken to verify this change does what is intended
Side effects of implementing this change
Before submitting this PR for review, please make sure you have:
Closes #