@staticmethod<EOL><INDENT>def get_course_run_id(user, enterprise_customer, course_key):<DEDENT>
try:<EOL><INDENT>course = CourseCatalogApiServiceClient(enterprise_customer.site).get_course_details(course_key)<EOL><DEDENT>except ImproperlyConfigured:<EOL><INDENT>raise Http404<EOL><DEDENT>users_all_enrolled_courses = EnrollmentApiClient().get_enrolled_courses(user.username)<EOL>users_active_course_runs = get_active_course_runs(<EOL>course,<EOL>users_all_enrolled_courses<EOL>) if users_all_enrolled_courses else []<EOL>course_run = get_current_course_run(course, users_active_course_runs)<EOL>if course_run:<EOL><INDENT>course_run_id = course_run['<STR_LIT:key>']<EOL>return course_run_id<EOL><DEDENT>else:<EOL><INDENT>raise Http404<EOL><DEDENT>
User is requesting a course, we need to translate that into the current course run.

:param user:
:param enterprise_customer:
:param course_key:
:return: course_run_id