- Create new cleanup_tenant command with better tenant deletion workflow
- Handle TenantRegistration automatic processing (keep history or delete)
- Add --purge-registration flag to remove TenantRegistration records
- Add --delete-files flag to remove physical tenant files from /media/tenants/
- Provide detailed deletion summary with confirmation step
- Update УДАЛЕНИЕ_ТЕНАНТОВ.md documentation with:
* Complete guide for new cleanup_tenant command
* Explanation of TenantRegistration problem and solutions
* Recommendations for different use cases (test vs production)
* Examples of all command variants
Tested:
- Successfully deleted grach tenant (no registration)
- Successfully deleted bingo tenant with --purge-registration flag
- Verified registration records are properly managed
- All database and file operations work correctly
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>