Skip to content

Refuse a negative --days in purge_completed_database_tasks - #70

Merged
tokibito merged 1 commit into
mainfrom
refuse-negative-purge-days
Oct 8, 2026
Merged

tokibito merged 1 commit into
mainfrom
refuse-negative-purge-days

Conversation

@tokibito

@tokibito tokibito commented Oct 8, 2026

Copy link
Copy Markdown
Owner

purge_completed_database_tasks treated a negative --days like --days 0 and deleted every completed task, while purge_completed_tasks() and the purge endpoint refuse a negative value. The command now raises CommandError before it counts or deletes anything, with the same message as purge_completed_redis_tasks in django-tasks-redis.

--days 0, positive values and the default are unchanged, so existing projects need no changes. The README and CHANGELOG are updated, and a new test covers the refusal.

Fixes #69

The command treated a negative --days like --days 0 and deleted every
completed task, while purge_completed_tasks() and the purge endpoint
refuse a negative value. It now raises CommandError before it counts or
deletes anything.

Fixes #69
@tokibito
tokibito merged commit bf257bc into main Oct 8, 2026
10 checks passed
@tokibito
tokibito deleted the refuse-negative-purge-days branch October 8, 2026 17:04
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.

Refuse a negative --days in purge_completed_database_tasks instead of deleting every completed task

1 participant