Move enterprise specific code in student_account views to enterprise_support

This commit is contained in:
Saleem Latif
2017-12-26 15:05:08 +05:00
parent 96977fe2de
commit 26cc70a7bc
4 changed files with 216 additions and 156 deletions

View File

@@ -485,6 +485,20 @@ def get_enterprise_learner_data(site, user):
return enterprise_learner_data['results']
def get_enterprise_customer_for_learner(site, user):
"""
Return enterprise customer to whom given learner belongs.
"""
if not enterprise_enabled():
return {}
enterprise_learner_data = get_enterprise_learner_data(site, user)
if enterprise_learner_data:
return enterprise_learner_data[0]['enterprise_customer']
return {}
def get_dashboard_consent_notification(request, user, course_enrollments):
"""
If relevant to the request at hand, create a banner on the dashboard indicating consent failed.