comments and code adjustments

This commit is contained in:
David Kennedy 2024-06-03 16:53:02 -04:00
parent 42a2e8d3ae
commit 4ff60817da
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
4 changed files with 60 additions and 12 deletions

View file

@ -4,6 +4,8 @@ from django.core.management import BaseCommand
from django.apps import apps
from django.db import transaction
from registrar.management.commands.utility.terminal_helper import TerminalHelper
logger = logging.getLogger(__name__)
@ -16,6 +18,24 @@ class Command(BaseCommand):
if settings.IS_PRODUCTION:
logger.error("clean_tables cannot be run in production")
return
TerminalHelper.prompt_for_execution(
system_exit_on_terminate=True,
info_to_inspect=f"""
This script will delete all rows from the following tables:
* Contact
* Domain
* DomainInformation
* DomainRequest
* DraftDomain
* Host
* HostIp
* PublicContact
* User
* Website
""",
prompt_title="Do you wish to proceed with these changes?",
)
table_names = [
"DomainInformation",