Skip to content

Commit aabafbc

Browse files
kiram15claude
andauthored
feat: remove enterprise dashboard context imports
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent ec13a6d commit aabafbc

10 files changed

Lines changed: 19 additions & 33 deletions

File tree

cms/envs/help_tokens.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ video = course_author:references/course_development/guide_to_video.html
2727
certificates = course_author:concepts/open_edx_platform/about_certificates.html
2828
content_highlights = course_author:how-tos/course_development/manage_course_highlight_emails.html
2929
social_sharing = course_author:how-tos/course_development/social_sharing.html
30-
sync_library_updates = course_author:how-tos/course_development/sync_a_library_update_to_your_course.html
3130

3231
# below are the language directory names for the different locales
3332
[locales]

common/djangoapps/student/views/dashboard.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@
5858
from openedx.core.djangolib.markup import HTML, Text
5959
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
6060
from openedx.features.course_duration_limits.access import get_user_course_duration, get_user_course_expiration_date
61-
from openedx.features.enterprise_support.api import (
62-
get_dashboard_consent_notification,
63-
get_enterprise_learner_portal_context,
64-
)
65-
from openedx.features.enterprise_support.utils import is_enterprise_learner
6661
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
6762

6863
log = logging.getLogger("edx.student")
@@ -619,7 +614,7 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
619614
link_end=HTML("</a>"),
620615
)
621616

622-
enterprise_message = get_dashboard_consent_notification(request, user, course_enrollments)
617+
enterprise_message = ''
623618

624619
recovery_email_message = recovery_email_activation_message = None
625620
if is_secondary_email_feature_enabled():
@@ -647,10 +642,6 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
647642
)
648643
)
649644

650-
# Disable lookup of Enterprise consent_required_course due to ENT-727
651-
# Will re-enable after fixing WL-1315
652-
consent_required_courses = set()
653-
654645
# Account activation message
655646
account_activation_messages = [
656647
message for message in messages.get_messages(request) if 'account-activation' in message.tags
@@ -802,7 +793,7 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
802793
'urls': urls,
803794
'programs_data': programs_data,
804795
'enterprise_message': enterprise_message,
805-
'consent_required_courses': consent_required_courses,
796+
'consent_required_courses': set(),
806797
'enrollment_message': enrollment_message,
807798
'redirect_message': Text(redirect_message),
808799
'account_activation_messages': account_activation_messages,
@@ -852,14 +843,8 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
852843
'course_info': get_dashboard_course_info(user, course_enrollments),
853844
# TODO START: clean up as part of REVEM-199 (END)
854845
'disable_unenrollment': disable_unenrollment,
855-
# TODO: clean when experiment(Merchandise 2U LOBs - Dashboard) would be stop. [VAN-1097]
856-
'is_enterprise_user': is_enterprise_learner(user),
857846
}
858847

859-
# Include enterprise learner portal metadata and messaging
860-
enterprise_learner_portal_context = get_enterprise_learner_portal_context(request)
861-
context.update(enterprise_learner_portal_context)
862-
863848
context_from_plugins = get_plugins_view_context(
864849
ProjectType.LMS,
865850
COURSE_DASHBOARD_PLUGIN_VIEW_NAME,

common/djangoapps/student/views/management.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@
2525
from django.template.context_processors import csrf
2626
from django.urls import reverse
2727
from django.utils.translation import gettext as _
28-
from django.views.decorators.csrf import ( # lint-amnesty, pylint: disable=unused-import # noqa: F401
29-
csrf_exempt,
30-
ensure_csrf_cookie,
31-
)
28+
from django.views.decorators.csrf import ensure_csrf_cookie # lint-amnesty, pylint: disable=unused-import # noqa: F401
3229
from django.views.decorators.http import ( # lint-amnesty, pylint: disable=unused-import
3330
require_GET,
34-
require_http_methods, # noqa: F401
3531
require_POST,
3632
)
3733
from edx_ace import ace
@@ -113,7 +109,6 @@
113109
from openedx.core.lib.api.authentication import BearerAuthenticationAllowInactiveUser
114110
from openedx.features.course_experience.url_helpers import make_learning_mfe_courseware_url
115111
from openedx.features.discounts.applicability import FIRST_PURCHASE_DISCOUNT_OVERRIDE_FLAG
116-
from openedx.features.enterprise_support.utils import is_enterprise_learner
117112
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
118113

119114
log = logging.getLogger("edx.student")
@@ -235,7 +230,6 @@ def compose_activation_email(
235230
message_context = generate_activation_email_context(user, user_registration)
236231
message_context.update({
237232
'confirm_activation_link': _get_activation_confirmation_link(message_context['key'], redirect_url),
238-
'is_enterprise_learner': is_enterprise_learner(user),
239233
'is_first_purchase_discount_overridden': FIRST_PURCHASE_DISCOUNT_OVERRIDE_FLAG.is_enabled(),
240234
'route_enabled': route_enabled,
241235
'routed_user': user.username,
@@ -708,7 +702,7 @@ def activate_account(request, key):
708702
url_path = '/login?{}'.format(urllib.parse.urlencode(params)) # noqa: UP032
709703
return redirect(settings.AUTHN_MICROFRONTEND_URL + url_path)
710704

711-
response = redirect(redirect_url) if redirect_url and is_enterprise_learner(request.user) else redirect('dashboard')
705+
response = redirect(redirect_url) if redirect_url else redirect('dashboard')
712706
if show_account_activation_popup:
713707
response.delete_cookie(
714708
settings.SHOW_ACTIVATE_CTA_POPUP_COOKIE_NAME,

common/djangoapps/third_party_auth/pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ def B(*args, **kwargs):
102102
from openedx.core.djangoapps.user_authn import cookies as user_authn_cookies
103103
from openedx.core.djangoapps.user_authn.toggles import is_auto_generated_username_enabled
104104
from openedx.core.djangoapps.user_authn.utils import is_safe_login_or_logout_redirect
105-
from openedx.core.djangoapps.user_authn.views.utils import get_auto_generated_username
106105

107106
from . import provider
108107

@@ -1010,6 +1009,7 @@ def get_username(strategy, details, backend, user=None, *args, **kwargs): # lin
10101009
slug_func = lambda val: val
10111010

10121011
if is_auto_generated_username_enabled() and details.get('username') is None:
1012+
from openedx.core.djangoapps.user_authn.views.utils import get_auto_generated_username # pylint: disable=import-outside-toplevel # noqa: I001
10131013
username = get_auto_generated_username(details)
10141014
else:
10151015
if email_as_username and details.get('email'):

lms/envs/common.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2954,7 +2954,6 @@
29542954
USER_STATE_BATCH_SIZE = 5000
29552955

29562956
############## Plugin Django Apps #########################
2957-
29582957
INSTALLED_APPS.extend(get_plugin_apps(ProjectType.LMS))
29592958
add_plugins(__name__, ProjectType.LMS, SettingsType.COMMON)
29602959

@@ -3282,3 +3281,12 @@ def _should_send_certificate_events(settings):
32823281
SSL_AUTH_DN_FORMAT_STRING = (
32833282
"/C=US/ST=Massachusetts/O=Massachusetts Institute of Technology/OU=Client CA v1/CN={0}/emailAddress={1}"
32843283
)
3284+
3285+
########################## OpenEdX Filters Configuration ####################
3286+
3287+
OPEN_EDX_FILTERS_CONFIG = {
3288+
"org.openedx.learning.dashboard.render.started.v1": {
3289+
"fail_silently": True,
3290+
"pipeline": ["enterprise.filters.dashboard.DashboardContextEnricher"],
3291+
},
3292+
}

requirements/constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ django-stubs<6
4444
# The team that owns this package will manually bump this package rather than having it pulled in automatically.
4545
# This is to allow them to better control its deployment and to do it in a process that works better
4646
# for them.
47-
edx-enterprise==8.0.0
47+
edx-enterprise==8.0.1
4848

4949
# Date: 2023-07-26
5050
# Our legacy Sass code is incompatible with anything except this ancient libsass version.

requirements/edx/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ edx-drf-extensions==10.6.0
483483
# enterprise-integrated-channels
484484
# openedx-authz
485485
# openedx-core
486-
edx-enterprise==8.0.0
486+
edx-enterprise==8.0.1
487487
# via
488488
# -c requirements/constraints.txt
489489
# -r requirements/edx/kernel.in

requirements/edx/development.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ edx-drf-extensions==10.6.0
762762
# enterprise-integrated-channels
763763
# openedx-authz
764764
# openedx-core
765-
edx-enterprise==8.0.0
765+
edx-enterprise==8.0.1
766766
# via
767767
# -c requirements/constraints.txt
768768
# -r requirements/edx/doc.txt

requirements/edx/doc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ edx-drf-extensions==10.6.0
573573
# enterprise-integrated-channels
574574
# openedx-authz
575575
# openedx-core
576-
edx-enterprise==8.0.0
576+
edx-enterprise==8.0.1
577577
# via
578578
# -c requirements/constraints.txt
579579
# -r requirements/edx/base.txt

requirements/edx/testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ edx-drf-extensions==10.6.0
593593
# enterprise-integrated-channels
594594
# openedx-authz
595595
# openedx-core
596-
edx-enterprise==8.0.0
596+
edx-enterprise==8.0.1
597597
# via
598598
# -c requirements/constraints.txt
599599
# -r requirements/edx/base.txt

0 commit comments

Comments
 (0)