From 342fc9dad5a29944d1f4b5ef0cf5810595f704e6 Mon Sep 17 00:00:00 2001 From: claire-peters Date: Thu, 21 Dec 2023 13:35:51 -0500 Subject: [PATCH] update run_view_db_checks to use env vars --- .../management/commands/run_view_db_checks.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/coldfront/plugins/fasrc_monitoring/management/commands/run_view_db_checks.py b/coldfront/plugins/fasrc_monitoring/management/commands/run_view_db_checks.py index 955a67c33..6d5e0f7dd 100644 --- a/coldfront/plugins/fasrc_monitoring/management/commands/run_view_db_checks.py +++ b/coldfront/plugins/fasrc_monitoring/management/commands/run_view_db_checks.py @@ -1,15 +1,13 @@ from django.core.management.base import BaseCommand from coldfront.plugins.fasrc_monitoring.utils import run_view_db_checks +from coldfront.core.utils.common import import_from_settings +from coldfront.config.env import ENV class Command(BaseCommand): help = 'automatically check pages and database entries for common issues.' - def add_arguments(self, parser): - parser.add_argument('username', nargs='+', type=str) - parser.add_argument('password', nargs='+', type=str) - def handle(self, *args, **options): - username = options['username'][0] - password = options['password'][0] + username = ENV.str('TESTUSER') + password = ENV.str('TESTPASS') run_view_db_checks(username, password)