Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinan029 committed Sep 30, 2024
2 parents da8a248 + a1dfc83 commit 67be4a2
Show file tree
Hide file tree
Showing 16 changed files with 103 additions and 81 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ Unreleased
---------
* feat: add new field to EnterpriseGroup model and EnterpriseGroupSerializer

[4.25.19]
---------
* feat: remove logging to debug SAP SuccessFactors transmission issues

[4.25.18]
---------
* chore: requirement updates

[4.25.17]
---------
* feat: add pagination to the support tool customer list

[4.25.16]
---------
* feat: add a waffle flag for enterprise groups v2 feature

[4.25.15]
---------
* fix: Don't import HttpClientError from edx-rest-api-client
Expand Down
11 changes: 8 additions & 3 deletions enterprise/api/v1/views/enterprise_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,22 @@ def basic_list(self, request, *arg, **kwargs):
# pylint: disable=unused-argument
def support_tool(self, request, *arg, **kwargs):
"""
Enterprise Customer's detail data for the support tool
Enterprise Customer's detail data with pagination for the support tool
Supported query param:
- uuid: filter the enterprise customer uuid .
- user_query: filter the enterprise customer name.
"""
enterprise_uuid = request.GET.get('uuid')
user_query = request.GET.get("user_query", None)
queryset = self.get_queryset().order_by('name')
if user_query:
queryset = queryset.filter(Q(slug__icontains=user_query) | Q(name__icontains=user_query))
if enterprise_uuid:
queryset = queryset.filter(uuid=enterprise_uuid)
serializer = self.get_serializer(queryset, many=True)
return Response(serializer.data)
page = self.paginate_queryset(queryset)
serializer = self.get_serializer(page, many=True)
return self.get_paginated_response(serializer.data)

@has_any_permissions('enterprise.can_access_admin_dashboard',
ENTERPRISE_CUSTOMER_PROVISIONING_ADMIN_ACCESS_PERMISSION)
Expand Down
20 changes: 20 additions & 0 deletions enterprise/toggles.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@
ENTERPRISE_LOG_PREFIX,
)

# .. toggle_name: enterprise.enterprise_groups_v2
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Enables enterprise groups feature
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2024-09-24
ENTERPRISE_GROUPS_V2 = WaffleFlag(
f'{ENTERPRISE_NAMESPACE}.enterprise_groups_v2',
__name__,
ENTERPRISE_LOG_PREFIX,
)


def top_down_assignment_real_time_lcm():
"""
Expand All @@ -77,6 +89,13 @@ def enterprise_groups_v1():
return ENTERPRISE_GROUPS_V1.is_enabled()


def enterprise_groups_v2():
"""
Returns whether the enterprise groups v2 feature flag is enabled.
"""
return ENTERPRISE_GROUPS_V2.is_enabled()


def enterprise_customer_support_tool():
"""
Returns whether the enterprise customer support tool is enabled.
Expand All @@ -93,4 +112,5 @@ def enterprise_features():
'feature_prequery_search_suggestions': feature_prequery_search_suggestions(),
'enterprise_groups_v1': enterprise_groups_v1(),
'enterprise_customer_support_tool': enterprise_customer_support_tool(),
'enterprise_groups_v2': enterprise_groups_v2(),
}
36 changes: 0 additions & 36 deletions integrated_channels/integrated_channel/exporters/learner_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ def bulk_assessment_level_export(self):
# Create a record of each subsection from every enterprise enrollment
for enterprise_enrollment in enrollment_queryset:
if not LearnerExporter.has_data_sharing_consent(enterprise_enrollment):
# Adding logging to debug the issue we are having with a customer using SAPSF channel
LOGGER.info(generate_formatted_log(
self.enterprise_configuration.channel_code(),
self.enterprise_configuration.enterprise_customer.uuid,
None,
None,
f'[SAPSF] Transmission skipped for {enterprise_enrollment.enterprise_customer_user.user_id}'
'due to missing data sharing consent.'
))
continue

assessment_grade_data = self._collect_assessment_grades_data(enterprise_enrollment)
Expand Down Expand Up @@ -201,16 +192,6 @@ def single_assessment_level_export(self, **kwargs):
detect_grade_updated=self.INCLUDE_GRADE_FOR_COMPLETION_AUDIT_CHECK,
)

# Adding logging to debug the issue we are having with a customer using SAPSF channel
LOGGER.info(generate_formatted_log( # pragma: no cover
self.enterprise_configuration.channel_code(),
self.enterprise_configuration.enterprise_customer.uuid,
None,
None,
f'[SAPSF] Transmission already sent for {enterprise_enrollment.enterprise_customer_user.user_id}'
f'is_already_transmitted returned {already_transmitted}'
))

if not (TransmissionAudit and already_transmitted) and LearnerExporter.has_data_sharing_consent(
enterprise_enrollment):

Expand All @@ -221,14 +202,6 @@ def single_assessment_level_export(self, **kwargs):
assessment_grade_data=assessment_grade_data,
)
if records:
# Adding logging to debug the issue we are having with a customer using SAPSF channel
LOGGER.info(generate_formatted_log( # pragma: no cover
self.enterprise_configuration.channel_code(),
self.enterprise_configuration.enterprise_customer.uuid,
None,
None,
f'[SAPSF] Transmission sent for {enterprise_enrollment.enterprise_customer_user.user_id}'
))
# There are some cases where we won't receive a record from the above
# method; right now, that should only happen if we have an Enterprise-linked
# user for the integrated channel, and transmission of that user's
Expand Down Expand Up @@ -524,15 +497,6 @@ def _filter_out_pre_transmitted_enrollments(
grade,
detect_grade_updated=self.INCLUDE_GRADE_FOR_COMPLETION_AUDIT_CHECK,
):
# Adding logging to debug the issue we are having with a customer using SAPSF channel
LOGGER.info(generate_formatted_log(
self.enterprise_configuration.channel_code(),
self.enterprise_configuration.enterprise_customer.uuid,
None,
None,
f'[SAPSF] Transmission skipped for {enterprise_enrollment.enterprise_customer_user.user_id}'
'transmission_audit and already_transmitted returned True.'
))
# We've already sent a completion status for this enrollment
LOGGER.info(generate_formatted_log(
channel_name, enterprise_customer_uuid, lms_user_id, course_id,
Expand Down
3 changes: 2 additions & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ disable =
no-member,
missing-timeout,
use-yield-from,
too-many-positional-arguments,

[REPORTS]
output-format = text
Expand Down Expand Up @@ -388,4 +389,4 @@ int-import-graph =
[EXCEPTIONS]
overgeneral-exceptions = builtins.Exception

# 126dc53d1644a269339811dea1e20f5bd1bf3264
# 54077c76e994996b5dcfc894527265ff056e760f
1 change: 1 addition & 0 deletions pylintrc_tweaks
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ disable+ =
no-member,
missing-timeout,
use-yield-from,
too-many-positional-arguments,
4 changes: 2 additions & 2 deletions requirements/celery53.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
amqp==5.2.0
billiard==4.2.0
billiard==4.2.1
celery==5.4.0
click==8.1.7
click-didyoumean==0.3.1
click-repl==0.3.0
kombu==5.4.1
kombu==5.4.2
prompt-toolkit==3.0.47
vine==5.1.0
6 changes: 3 additions & 3 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
#
distlib==0.3.8
# via virtualenv
filelock==3.16.0
filelock==3.16.1
# via
# tox
# virtualenv
packaging==24.1
# via tox
platformdirs==4.3.3
platformdirs==4.3.6
# via virtualenv
pluggy==1.5.0
# via tox
Expand All @@ -24,5 +24,5 @@ tox==3.28.0
# via
# -c requirements/constraints.txt
# -r requirements/ci.in
virtualenv==20.26.4
virtualenv==20.26.5
# via tox
13 changes: 7 additions & 6 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ asn1crypto==1.5.1
# -r requirements/test-master.txt
# -r requirements/test.txt
# snowflake-connector-python
astroid==3.2.4
astroid==3.3.3
# via
# pylint
# pylint-celery
Expand All @@ -82,7 +82,7 @@ beautifulsoup4==4.12.3
# via
# -r requirements/doc.txt
# pydata-sphinx-theme
billiard==4.2.0
billiard==4.2.1
# via
# -r requirements/doc.txt
# -r requirements/test-master.txt
Expand Down Expand Up @@ -408,7 +408,7 @@ factory-boy==3.3.1
# -c requirements/constraints.txt
# -r requirements/doc.txt
# -r requirements/test.txt
faker==28.4.1
faker==29.0.0
# via
# -r requirements/doc.txt
# -r requirements/test.txt
Expand Down Expand Up @@ -489,7 +489,7 @@ jwcrypto==1.5.6
# -r requirements/test-master.txt
# -r requirements/test.txt
# django-oauth-toolkit
kombu==5.4.1
kombu==5.4.2
# via
# -r requirements/doc.txt
# -r requirements/test-master.txt
Expand Down Expand Up @@ -669,7 +669,7 @@ pyjwt[crypto]==2.9.0
# edx-drf-extensions
# edx-rest-api-client
# snowflake-connector-python
pylint==3.2.7
pylint==3.3.0
# via
# edx-lint
# pylint-celery
Expand Down Expand Up @@ -932,6 +932,7 @@ tzdata==2024.1
# -r requirements/test-master.txt
# -r requirements/test.txt
# celery
# kombu
unicodecsv==0.14.1
# via
# -r requirements/doc.txt
Expand All @@ -957,7 +958,7 @@ vine==5.1.0
# amqp
# celery
# kombu
virtualenv==20.26.4
virtualenv==20.26.5
# via tox
wcwidth==0.2.13
# via
Expand Down
7 changes: 4 additions & 3 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bcrypt==4.2.0
# paramiko
beautifulsoup4==4.12.3
# via pydata-sphinx-theme
billiard==4.2.0
billiard==4.2.1
# via
# -r requirements/test-master.txt
# celery
Expand Down Expand Up @@ -248,7 +248,7 @@ factory-boy==3.3.1
# via
# -c requirements/constraints.txt
# -r requirements/doc.in
faker==28.4.1
faker==29.0.0
# via factory-boy
fastavro==1.9.5
# via
Expand Down Expand Up @@ -290,7 +290,7 @@ jwcrypto==1.5.6
# via
# -r requirements/test-master.txt
# django-oauth-toolkit
kombu==5.4.1
kombu==5.4.2
# via
# -r requirements/test-master.txt
# celery
Expand Down Expand Up @@ -523,6 +523,7 @@ tzdata==2024.1
# via
# -r requirements/test-master.txt
# celery
# kombu
unicodecsv==0.14.1
# via -r requirements/test-master.txt
uritemplate==4.1.1
Expand Down
12 changes: 5 additions & 7 deletions requirements/edx-platform-constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ edx-drf-extensions==10.3.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==4.25.11
edx-enterprise==4.25.13
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand All @@ -470,10 +470,8 @@ edx-i18n-tools==1.5.0
# ora2
edx-milestones==0.6.0
# via -r requirements/edx/kernel.in
edx-name-affirmation==2.4.0
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
edx-name-affirmation==2.4.1
# via -r requirements/edx/kernel.in
edx-opaque-keys[django]==2.11.0
# via
# -r requirements/edx/kernel.in
Expand Down Expand Up @@ -810,7 +808,7 @@ openedx-filters==1.9.0
# -r requirements/edx/kernel.in
# lti-consumer-xblock
# ora2
openedx-learning==0.11.4
openedx-learning==0.11.5
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand All @@ -820,7 +818,7 @@ optimizely-sdk==4.1.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/bundled.in
ora2==6.11.2
ora2==6.12.0
# via -r requirements/edx/bundled.in
packaging==24.1
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements/js_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ python-dateutil==2.9.0.post0
# via tempora
pyyaml==6.0.2
# via jasmine
selenium==4.24.0
selenium==4.25.0
# via jasmine
six==1.16.0
# via python-dateutil
Expand Down
5 changes: 3 additions & 2 deletions requirements/test-master.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bcrypt==4.2.0
# via
# -c requirements/edx-platform-constraints.txt
# paramiko
billiard==4.2.0
billiard==4.2.1
# via celery
bleach==6.1.0
# via
Expand Down Expand Up @@ -297,7 +297,7 @@ jwcrypto==1.5.6
# via
# -c requirements/edx-platform-constraints.txt
# django-oauth-toolkit
kombu==5.4.1
kombu==5.4.2
# via celery
markupsafe==2.1.5
# via
Expand Down Expand Up @@ -494,6 +494,7 @@ tzdata==2024.1
# via
# -c requirements/edx-platform-constraints.txt
# celery
# kombu
unicodecsv==0.14.1
# via
# -c requirements/edx-platform-constraints.txt
Expand Down
3 changes: 2 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ factory-boy==3.3.1
# via
# -c requirements/constraints.txt
# -r requirements/test.in
faker==28.4.1
faker==29.0.0
# via factory-boy
fastavro==1.9.5
# via
Expand Down Expand Up @@ -486,6 +486,7 @@ tzdata==2024.1
# via
# -r requirements/test-master.txt
# celery
# kombu
unicodecsv==0.14.1
# via -r requirements/test-master.txt
uritemplate==4.1.1
Expand Down
Loading

0 comments on commit 67be4a2

Please sign in to comment.