Merge pull request #22590 from edx/azarembok/fix-retry-verifications

PROD-1113: Fix retry_failed_photo_verifications.
This commit is contained in:
Alan Zarembok
2019-12-23 11:25:27 -05:00
committed by GitHub
2 changed files with 9 additions and 4 deletions

View File

@@ -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()

View File

@@ -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'