Skip to content
10 changes: 7 additions & 3 deletions common/djangoapps/student/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@

# try to import appsembler fork of edx-organizations (if it's installed)
try:
from organizations.models import UserOrganizationMapping
from organizations.models import Organization, UserOrganizationMapping
from hr_management.views import send_microsite_request_email_to_managers
except ImportError:
pass

Expand Down Expand Up @@ -348,7 +349,8 @@ def _cert_info(user, course_overview, cert_status, course_mode): # pylint: disa
CertificateStatuses.unverified: 'unverified',
}

default_status = 'processing'
# open-ended courses should not display the 'processing' message
default_status = 'unavailable' if not course_overview.end else 'processing'

default_info = {
'status': default_status,
Expand Down Expand Up @@ -1865,9 +1867,11 @@ def create_account_with_params(request, params):

#if using custom Appsembler backend from edx-organizations
if u'organizations.backends.OrganizationMemberBackend' in settings.AUTHENTICATION_BACKENDS:
organization = request.site.organizations.first()
org = configuration_helpers.get_value('course_org_filter')
organization = Organization.objects.filter(name=org).first()
if organization:
UserOrganizationMapping.objects.get_or_create(user=user, organization=organization, is_active=False)
send_microsite_request_email_to_managers(request, user)

# Immediately after a user creates an account, we log them in. They are only
# logged in until they close the browser. They can't log in again until they click
Expand Down
14 changes: 14 additions & 0 deletions lms/djangoapps/courseware/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@
from ..entrance_exams import user_must_complete_entrance_exam
from ..module_render import get_module_for_descriptor, get_module, get_module_by_usage_id

#specific to our hr_management app
try:
from hr_management.models import CourseCCASettings
except ImportError:
pass

log = logging.getLogger("edx.courseware")


Expand Down Expand Up @@ -668,6 +674,14 @@ def course_about(request, course_id):
}
inject_coursetalk_keys_into_context(context, course_key)

# check hr_management access request settings
try:
course_cca_settings, created = CourseCCASettings.objects.get_or_create(course_id=course_key)
except NameError:
pass
else:
context['require_access_request'] = course_cca_settings.require_access_request

return render_to_response('courseware/course_about.html', context)


Expand Down
7 changes: 7 additions & 0 deletions lms/envs/appsembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@
INTERCOM_APP_ID = APPSEMBLER_FEATURES.get('INTERCOM_APP_ID', os.environ.get('INTERCOM_APP_ID', ''))
INTERCOM_API_KEY = APPSEMBLER_FEATURES.get('INTERCOM_API_KEY', os.environ.get('INTERCOM_API_KEY', ''))
INTERCOM_USER_EMAIL = APPSEMBLER_FEATURES.get('INTERCOM_USER_EMAIL', os.environ.get('INTERCOM_USER_EMAIL', ''))


if APPSEMBLER_FEATURES.get('ENABLE_APPSEMBLER_REPORTING', False):
from appsembler_reporting.settings import APPSEMBLER_REPORTING

APPSEMBLER_REPORTING.update(APPSEMBLER_FEATURES.get(
'APPSEMBLER_REPORTING', {} ))