diff --git a/lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py b/lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py index d75e5a6335..515c3ad8eb 100644 --- a/lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py +++ b/lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py @@ -46,7 +46,8 @@ class Command(BaseCommand): sspv_retry_config = SSPVerificationRetryConfig.current() if not sspv_retry_config.enabled: - raise CommandError('SSPVerificationRetryConfig is disabled, but --args-from-database was requested.') + log.warning('SSPVerificationRetryConfig is disabled or empty, but --args-from-database was requested.') + return {} # We don't need fancy shell-style whitespace/quote handling - none of our arguments are complicated argv = sspv_retry_config.arguments.split() diff --git a/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py b/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py index 986aa2ffe2..6fdc032b52 100644 --- a/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py +++ b/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py @@ -73,10 +73,14 @@ class TestVerifyStudentCommand(MockS3Mixin, TestCase): """Test management command arguments injected from config model.""" # Nothing in the database, should default to disabled - # pylint: disable=deprecated-method, useless-suppression - with self.assertRaisesRegex(CommandError, 'SSPVerificationRetryConfig is disabled*'): + with LogCapture(LOGGER_NAME) as log: call_command('retry_failed_photo_verifications', '--args-from-database') - + log.check_present( + ( + LOGGER_NAME, 'WARNING', + u"SSPVerificationRetryConfig is disabled or empty, but --args-from-database was requested." + ), + ) # Add a config config = SSPVerificationRetryConfig.current() config.arguments = '--verification-ids 1 2 3'