finished options for running loader scripts. Added boilerplate for simulating logins

This commit is contained in:
CocoByte 2023-10-24 00:23:45 -06:00
parent d5c0ac7a0c
commit cb3cfe3a6d
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
3 changed files with 162 additions and 55 deletions

View file

@ -297,20 +297,29 @@ class Command(BaseCommand):
)
TransitionDomain.objects.all().delete()
def parse_files(self, # noqa: C901
def handle( # noqa: C901
self,
domain_contacts_filename,
contacts_filename,
domain_statuses_filename,
reset_table,
sep,
debug_on,
debug_max_entries_to_parse):
**options,
):
"""Parse the data files and create TransitionDomains."""
sep = options.get("sep")
# If --resetTable was used, prompt user to confirm
# deletion of table data
if reset_table:
if options.get("resetTable"):
self.prompt_table_reset()
# Get --debug argument
debug_on = options.get("debug")
# Get --LimitParse argument
debug_max_entries_to_parse = int(
options.get("limitParse")
) # set to 0 to parse all entries
# print message to terminal about which args are in use
self.print_debug_mode_statements(debug_on, debug_max_entries_to_parse)
@ -513,32 +522,3 @@ class Command(BaseCommand):
duplicate_domain_user_combos, duplicate_domains, users_without_email
)
self.print_summary_status_findings(domains_without_status, outlier_statuses)
def handle(
self,
domain_contacts_filename,
contacts_filename,
domain_statuses_filename,
**options,
):
"""Parse the data files and create TransitionDomains."""
# Get --sep argument
sep = options.get("sep")
# Get --resetTable argument
reset_table = options.get("resetTable")
# Get --debug argument
debug_on = options.get("debug")
# Get --limitParse argument
debug_max_entries_to_parse = int(
options.get("limitParse")
) # set to 0 to parse all entries
self.parse_files(domain_contacts_filename,
contacts_filename,
domain_statuses_filename,
sep,
reset_table,
debug_on,
debug_max_entries_to_parse)