def get_base_details(self, request, enterprise_uuid, course_run_id):
enterprise_customer = get_enterprise_customer_or_404(enterprise_uuid)<EOL>enterprise_catalog_uuid = request.GET.get('<STR_LIT>')<EOL>enterprise_catalog = None<EOL>if enterprise_catalog_uuid:<EOL><INDENT>try:<EOL><INDENT>enterprise_catalog_uuid = UUID(enterprise_catalog_uuid)<EOL>enterprise_catalog = enterprise_customer.enterprise_customer_catalogs.get(<EOL>uuid=enterprise_catalog_uuid<EOL>)<EOL><DEDENT>except (ValueError, EnterpriseCustomerCatalog.DoesNotExist):<EOL><INDENT>LOGGER.warning(<EOL>'<STR_LIT>'.format(<EOL>enterprise_catalog_uuid=enterprise_catalog_uuid,<EOL>)<EOL>)<EOL>messages.add_generic_info_message_for_error(request)<EOL><DEDENT><DEDENT>course = None<EOL>course_run = None<EOL>course_modes = []<EOL>if enterprise_catalog:<EOL><INDENT>course, course_run = enterprise_catalog.get_course_and_course_run(course_run_id)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>course, course_run = CourseCatalogApiServiceClient(<EOL>enterprise_customer.site<EOL>).get_course_and_course_run(course_run_id)<EOL><DEDENT>except ImproperlyConfigured:<EOL><INDENT>LOGGER.warning('<STR_LIT>')<EOL>messages.add_generic_info_message_for_error(request)<EOL>return enterprise_customer, course, course_run, course_modes<EOL><DEDENT><DEDENT>if not course or not course_run:<EOL><INDENT>course_id = course['<STR_LIT:key>'] if course else "<STR_LIT>"<EOL>course_title = course['<STR_LIT:title>'] if course else "<STR_LIT>"<EOL>course_run_title = course_run['<STR_LIT:title>'] if course_run else "<STR_LIT>"<EOL>enterprise_catalog_title = enterprise_catalog.title if enterprise_catalog else "<STR_LIT>"<EOL>LOGGER.warning(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>course_title=course_title,<EOL>course_id=course_id,<EOL>course_run_title=course_run_title,<EOL>course_run_id=course_run_id,<EOL>enterprise_name=enterprise_customer.name,<EOL>enterprise_uuid=enterprise_customer.uuid,<EOL>enterprise_catalog_title=enterprise_catalog_title,<EOL>enterprise_catalog_uuid=enterprise_catalog_uuid,<EOL>)<EOL>)<EOL>messages.add_generic_info_message_for_error(request)<EOL>return enterprise_customer, course, course_run, course_modes<EOL><DEDENT>if enterprise_catalog_uuid and not enterprise_catalog:<EOL><INDENT>return enterprise_customer, course, course_run, course_modes<EOL><DEDENT>modes = self.get_available_course_modes(request, course_run_id, enterprise_catalog)<EOL>audit_modes = getattr(<EOL>settings,<EOL>'<STR_LIT>',<EOL>['<STR_LIT>', '<STR_LIT>']<EOL>)<EOL>for mode in modes:<EOL><INDENT>if mode['<STR_LIT>']:<EOL><INDENT>price_text = get_price_text(mode['<STR_LIT>'], request)<EOL><DEDENT>else:<EOL><INDENT>price_text = _('<STR_LIT>')<EOL><DEDENT>if mode['<STR_LIT>'] in audit_modes:<EOL><INDENT>description = _('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>description = _('<STR_LIT>')<EOL><DEDENT>course_modes.append({<EOL>'<STR_LIT>': mode['<STR_LIT>'],<EOL>'<STR_LIT>': mode['<STR_LIT>'],<EOL>'<STR_LIT>': mode['<STR_LIT>'],<EOL>'<STR_LIT:title>': mode['<STR_LIT:name>'],<EOL>'<STR_LIT>': price_text,<EOL>'<STR_LIT>': price_text,<EOL>'<STR_LIT:description>': description,<EOL>'<STR_LIT>': mode['<STR_LIT>'] not in audit_modes<EOL>})<EOL><DEDENT>return enterprise_customer, course, course_run, course_modes<EOL>
Retrieve fundamental details used by both POST and GET versions of this view.

Specifically, take an EnterpriseCustomer UUID and a course run ID, and transform those
into an actual EnterpriseCustomer, a set of details about the course, and a list
of the available course modes for that course run.