Skip to content

Reuse delete_stale_comments command - #349

Merged
atodorov merged 1 commit into
masterfrom
refactor-stale-comments
Oct 5, 2026
Merged

atodorov merged 1 commit into
masterfrom
refactor-stale-comments

Conversation

@kiwitcms-bot

Copy link
Copy Markdown
Member

Refactor remove_stale_tenant_comments so it inherits from django_comments.management.commands.delete_stale_comments.Command and delegates the removal of comments whose related object is gone to super().handle(), once per tenant. Same approach as #348.

handle() only adds the multi-tenant loop plus --dry-run: answer is forced to n before looping, so the upstream command reports each match without deleting. The -y/--yes option comes from upstream.

Tests: the empty-object_pk fixtures/assertions are dropped since that case is no longer special-cased, and a dry-run test is added. tcms_tenants/tests/test_remove_stale_tenant_comments.py passes.

@atodorov
atodorov merged commit b336a4a into master Oct 5, 2026
7 checks passed
@atodorov
atodorov deleted the refactor-stale-comments branch October 5, 2026 14:07
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.

2 participants