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

Added command to delete drafts that haven't been modified in specified days #4133

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

wes-otf
Copy link
Contributor

@wes-otf wes-otf commented Sep 13, 2024

Adds a management command to delete all drafts older than two years. Intended to be used with a cron job to consistently clean up drafts.

Test Steps

  • Ensure all drafts older than 2 years get removed after command is run

@wes-otf wes-otf added Type: Feature This is something new (not an enhancement of an existing thing). Type: Minor Minor change, used in release drafter labels Sep 13, 2024
@wes-otf wes-otf requested a review from frjo September 13, 2024 15:41
@frjo
Copy link
Contributor

frjo commented Sep 16, 2024

Looks good. Maybe two years is a bit overly cautious?

@wes-otf wes-otf changed the title Added command to delete all drafts older than 2 years Added command to delete all drafts older than a specified time Sep 17, 2024
@wes-otf wes-otf force-pushed the feature/add-clear-old-drafts-command branch from ed5bb22 to 899760a Compare September 17, 2024 22:22
@wes-otf
Copy link
Contributor Author

wes-otf commented Sep 17, 2024

@frjo I talked with @Techslammer about this and we figured it might make more sense to make this a customizable time rather than doing something hard coded as different instances needs/sensitivities will probably differ. So now the command format is:

python3 manage.py drafts_cleanup <drafts older than days>

I also added a confirmation which can be skipped with --noinput/--no-input, ie.

python3 manage.py drafts_cleanup 365 --noinput

@wes-otf wes-otf force-pushed the feature/add-clear-old-drafts-command branch from f792577 to 3f73191 Compare September 18, 2024 20:01
@wes-otf wes-otf requested a review from frjo September 18, 2024 20:02
@wes-otf wes-otf changed the title Added command to delete all drafts older than a specified time Added command to delete drafts that haven't been modified in specified days Sep 18, 2024
@frjo frjo merged commit 94095fd into main Sep 19, 2024
10 checks passed
@theskumar theskumar deleted the feature/add-clear-old-drafts-command branch September 21, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature This is something new (not an enhancement of an existing thing). Type: Minor Minor change, used in release drafter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants