Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/decisions/0010-extract-enrollment-python-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ We are not changing the POST handler because it serves various use cases and par
performs authorization checks on request object, none of which are needed and would require careful
and rigorous testing of various enrollment flows, and also introduce risk of regressions if done in a single round of work.

We will add a new function to the `enterprise_support` package in edx-platform to achieve this.
We will add a new function to the `enterprise_support` package (since moved out of edx-platform
and into edx-enterprise as `enterprise.platform_support`) to achieve this.

A few other features of the endpoint are also not needed in order to obtain the functionality needed
to replace the existing POST call:
Expand Down
1 change: 0 additions & 1 deletion lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,6 @@
'openedx.features.calendar_sync',
'openedx.features.course_bookmarks',
'openedx.features.course_experience',
'openedx.features.enterprise_support.apps.EnterpriseSupportConfig',
'openedx.features.course_duration_limits',
'openedx.features.content_type_gating',
'openedx.features.discounts',
Expand Down
20 changes: 18 additions & 2 deletions lms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

from config_models.views import ConfigurationModelCurrentAPIView
from django.apps import apps as django_apps
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
Expand Down Expand Up @@ -51,7 +52,6 @@
from openedx.core.djangoapps.programs.models import ProgramsApiConfig
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_authn.views.login import redirect_to_lms_login
from openedx.features.enterprise_support.api import enterprise_enabled

RESET_COURSE_DEADLINES_NAME = 'reset_course_deadlines'
RENDER_XBLOCK_NAME = 'render_xblock'
Expand Down Expand Up @@ -880,8 +880,24 @@
path('api/third_party_auth/', include('common.djangoapps.third_party_auth.api.urls')),
]


def _enterprise_enabled():
"""
Whether the enterprise feature is installed and enabled.

Temporary duplicate of the helper that now lives in edx-enterprise
(``enterprise.platform_support.api.enterprise_enabled``), kept here only
because ``channel_integrations.urls`` still has to be included by the
platform. Remove this function and the whole block below once
enterprise-integrated-channels is modernized into a true plugin that
injects its own URLs via ``url_config``, at which point ``enterprise.urls``
moves there too.
"""
return django_apps.is_installed('enterprise') and getattr(settings, 'ENABLE_ENTERPRISE_INTEGRATION', False)


# Enterprise
if enterprise_enabled():
if _enterprise_enabled():
urlpatterns += [
path('', include('enterprise.urls')),
path('', include('channel_integrations.urls')),
Expand Down
11 changes: 0 additions & 11 deletions openedx/core/djangoapps/user_api/accounts/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
UserNotFound,
)
from openedx.core.djangolib.testing.utils import skip_unless_lms
from openedx.features.enterprise_support.tests.factories import EnterpriseCustomerUserFactory


def mock_render_to_string(template_name, context):
Expand Down Expand Up @@ -264,16 +263,6 @@ def test_unsupported_social_link_platform(self):
with pytest.raises(AccountValidationError):
update_account_settings(self.user, {"social_links": social_links})

def test_update_success_for_enterprise(self):
EnterpriseCustomerUserFactory(user_id=self.user.id)
level_of_education = "m"
successful_update = {
"level_of_education": level_of_education,
}
update_account_settings(self.user, successful_update)
account_settings = get_account_settings(self.default_request)[0]
assert level_of_education == account_settings['level_of_education']

@patch(
'openedx.core.djangoapps.user_api.accounts.api.AccountSettingsReadOnlyFieldsRequested.run_filter',
return_value=({'country'}, None),
Expand Down
7 changes: 0 additions & 7 deletions openedx/features/enterprise_support/README.rst

This file was deleted.

Empty file.
Empty file.
21 changes: 0 additions & 21 deletions openedx/features/enterprise_support/admin/forms.py

This file was deleted.

71 changes: 0 additions & 71 deletions openedx/features/enterprise_support/admin/views.py

This file was deleted.

Loading
Loading