Merge pull request #19918 from edx/waheed/LEARNER-6643-return-credit-status-error

Return credit status error if no provider info found.
This commit is contained in:
Waheed Ahmed
2019-03-04 17:27:44 +05:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -510,6 +510,14 @@ def _credit_statuses(user, course_enrollments):
status["provider_status_url"] = provider_info.get("status_url")
status["provider_id"] = provider_id
if not status["provider_name"] and not status["provider_status_url"]:
status["error"] = True
log.error(
u"Could not find credit provider info for [%s] in [%s]. The user will not "
u"be able to see his or her credit request status on the student dashboard.",
provider_id, provider_info_by_id
)
statuses[course_key] = status
return statuses

View File

@@ -184,8 +184,6 @@ class CreditProvider(TimeStampedModel):
]
cache.set(cls.CREDIT_PROVIDERS_CACHE_KEY, credit_providers)
else:
log.info(u"Found %d credit providers from cache.", len(credit_providers))
if providers_list:
credit_providers = [provider for provider in credit_providers if provider['id'] in providers_list]