mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-20 00:14:16 +02:00
updated documentation, disallow clean and import scripts in production
This commit is contained in:
parent
9f973938a3
commit
736189e22c
3 changed files with 21 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
import logging
|
||||
from django.conf import settings
|
||||
from django.core.management import BaseCommand
|
||||
from django.apps import apps
|
||||
from django.db import transaction
|
||||
|
@ -10,9 +11,14 @@ class Command(BaseCommand):
|
|||
|
||||
def handle(self, **options):
|
||||
"""Delete all rows from a list of tables"""
|
||||
|
||||
if settings.IS_PRODUCTION:
|
||||
logger.error("clean_tables cannot be run in production")
|
||||
return
|
||||
|
||||
table_names = [
|
||||
"DomainInformation", "DomainRequest", "Domain", "User", "Contact",
|
||||
"Website", "DraftDomain", "HostIp", "Host", "PublicContact"
|
||||
"DomainInformation", "DomainRequest", "PublicContact", "Domain", "User",
|
||||
"Contact", "Website", "DraftDomain", "HostIp", "Host"
|
||||
]
|
||||
|
||||
for table_name in table_names:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue