Merge pull request #18594 from edx/tasawer/learner-4467/fix-exception-handling-in-award-program-certificate-task

Fix exception handling in award program certificate task
This commit is contained in:
Tasawer Nawaz
2018-07-17 10:38:27 +05:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -173,7 +173,7 @@ def award_program_certificates(self, username):
try:
award_program_certificate(credentials_client, username, program_uuid)
LOGGER.info('Awarded certificate for program %s to user %s', program_uuid, username)
except exceptions.HttpNotFoundError:
except exceptions.HttpClientError:
LOGGER.exception(
'Certificate for program %s not configured, unable to award certificate to %s',
program_uuid, username

View File

@@ -301,7 +301,7 @@ class AwardProgramCertificatesTestCase(CatalogIntegrationMixin, CredentialsApiCo
mock_get_completed_programs.return_value = [1, 2]
mock_get_certified_programs.side_effect = [[], [2]]
mock_award_program_certificate.side_effect = self._make_side_effect(
[exceptions.HttpNotFoundError(), None]
[exceptions.HttpClientError(), None]
)
tasks.award_program_certificates.delay(self.student.username).get()