edx-enterprise-data 9.2.0__py3-none-any.whl → 9.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {edx_enterprise_data-9.2.0.dist-info → edx_enterprise_data-9.2.1.dist-info}/METADATA +1 -1
- {edx_enterprise_data-9.2.0.dist-info → edx_enterprise_data-9.2.1.dist-info}/RECORD +7 -7
- enterprise_data/__init__.py +1 -1
- enterprise_data/api/v1/views/enterprise_learner.py +21 -12
- {edx_enterprise_data-9.2.0.dist-info → edx_enterprise_data-9.2.1.dist-info}/LICENSE +0 -0
- {edx_enterprise_data-9.2.0.dist-info → edx_enterprise_data-9.2.1.dist-info}/WHEEL +0 -0
- {edx_enterprise_data-9.2.0.dist-info → edx_enterprise_data-9.2.1.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
enterprise_data/__init__.py,sha256=
|
1
|
+
enterprise_data/__init__.py,sha256=KS1OhKyx-0mFThb9u4NNxgV6czgcEVQvwYjdMMkap5Y,123
|
2
2
|
enterprise_data/apps.py,sha256=aF6hZwDfI2oWj95tUTm_2ikHueQj-jLj-u0GrgzpsQI,414
|
3
3
|
enterprise_data/clients.py,sha256=GvQupy5TVYfO_IKC3yzXSAgNP54r-PtIjidM5ws9Iks,3947
|
4
4
|
enterprise_data/constants.py,sha256=uCKjfpdlMYFZJsAj3n9RMw4Cmg5_6s3NuwocO-fch3s,238
|
@@ -39,7 +39,7 @@ enterprise_data/api/v1/views/analytics_enrollments.py,sha256=HXgoFwvXk-CZcf6qbVO
|
|
39
39
|
enterprise_data/api/v1/views/analytics_leaderboard.py,sha256=zwd-2A2sctjAdx5BUjCqiwcZ5aNvM8wfm386pR-RwGQ,4114
|
40
40
|
enterprise_data/api/v1/views/base.py,sha256=Kkmd5zgEBAhvwS_GoGXSK6lgbDNwSPioYn-QbnizI3w,3416
|
41
41
|
enterprise_data/api/v1/views/enterprise_admin.py,sha256=DsR1oHFhe6LCIFjIJ4YLLZ7PUChvNlFfdZD-sxHoijY,7388
|
42
|
-
enterprise_data/api/v1/views/enterprise_learner.py,sha256=
|
42
|
+
enterprise_data/api/v1/views/enterprise_learner.py,sha256=xy9DwCy2eYLnb0z3XolOstxf9faIPHG2aXUXSuWrodM,19231
|
43
43
|
enterprise_data/api/v1/views/enterprise_offers.py,sha256=VifxgqTLFLVw4extYPlHcN1N_yjXcsYsAlYEnAbpb10,1266
|
44
44
|
enterprise_data/fixtures/enterprise_enrollment.json,sha256=6onPXXR29pMdTdbl_mn81sDi3Re5jkLUZz2TPMB_1IY,5786
|
45
45
|
enterprise_data/fixtures/enterprise_user.json,sha256=6g8GvNY9j_fh1dvAU80bTAMI2F5vXCkb8a4UjsftMvQ,1970
|
@@ -167,8 +167,8 @@ enterprise_reporting/tests/test_send_enterprise_reports.py,sha256=WtL-RqGgu2x5PP
|
|
167
167
|
enterprise_reporting/tests/test_utils.py,sha256=Zt_TA0LVb-B6fQGkUkAKKVlUKKnQh8jnw1US1jKe7g8,9493
|
168
168
|
enterprise_reporting/tests/test_vertica_client.py,sha256=-R2yNCGUjRtoXwLMBloVFQkFYrJoo613VCr61gwI3kQ,140
|
169
169
|
enterprise_reporting/tests/utils.py,sha256=xms2LM7DV3wczXEfctOK1ddel1EE0J_YSr17UzbCDy4,1401
|
170
|
-
edx_enterprise_data-9.2.
|
171
|
-
edx_enterprise_data-9.2.
|
172
|
-
edx_enterprise_data-9.2.
|
173
|
-
edx_enterprise_data-9.2.
|
174
|
-
edx_enterprise_data-9.2.
|
170
|
+
edx_enterprise_data-9.2.1.dist-info/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
|
171
|
+
edx_enterprise_data-9.2.1.dist-info/METADATA,sha256=ThIreeBfPl0yvMU4JURsx2TnlXEizu5eCi6f38iAr2A,1569
|
172
|
+
edx_enterprise_data-9.2.1.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
173
|
+
edx_enterprise_data-9.2.1.dist-info/top_level.txt,sha256=f5F2kU-dob6MqiHJpgZkFzoCD5VMhsdpkTV5n9Tvq3I,59
|
174
|
+
edx_enterprise_data-9.2.1.dist-info/RECORD,,
|
enterprise_data/__init__.py
CHANGED
@@ -6,6 +6,7 @@ from datetime import date, timedelta
|
|
6
6
|
from logging import getLogger
|
7
7
|
from uuid import UUID
|
8
8
|
|
9
|
+
from edx_django_utils.cache import TieredCache
|
9
10
|
from rest_framework import filters, viewsets
|
10
11
|
from rest_framework.decorators import action
|
11
12
|
from rest_framework.response import Response
|
@@ -18,12 +19,13 @@ from django.db.models.functions import Coalesce
|
|
18
19
|
from django.http import StreamingHttpResponse
|
19
20
|
from django.utils import timezone
|
20
21
|
|
22
|
+
from enterprise_data.admin_analytics.database.utils import LOGGER
|
21
23
|
from enterprise_data.api.v1 import serializers
|
22
24
|
from enterprise_data.filters import AuditEnrollmentsFilterBackend, AuditUsersEnrollmentFilterBackend
|
23
25
|
from enterprise_data.models import EnterpriseLearner, EnterpriseLearnerEnrollment
|
24
26
|
from enterprise_data.paginators import EnterpriseEnrollmentsPagination
|
25
27
|
from enterprise_data.renderers import EnrollmentsCSVRenderer
|
26
|
-
from enterprise_data.utils import subtract_one_month
|
28
|
+
from enterprise_data.utils import get_cache_key, subtract_one_month
|
27
29
|
|
28
30
|
from .base import EnterpriseViewSetMixin
|
29
31
|
|
@@ -82,19 +84,26 @@ class EnterpriseLearnerEnrollmentViewSet(EnterpriseViewSetMixin, viewsets.ReadOn
|
|
82
84
|
enterprise_customer_uuid = self.kwargs['enterprise_id']
|
83
85
|
|
84
86
|
# TODO: Created a ticket ENT0-9531 to fix the cache issue
|
85
|
-
#
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
87
|
+
# Temporary logging to test cache issue
|
88
|
+
try:
|
89
|
+
LOGGER.info("Trying to get Learner Enrollment data from Cache")
|
90
|
+
cache_key = get_cache_key(
|
91
|
+
resource='enterprise-learner',
|
92
|
+
enterprise_customer=enterprise_customer_uuid,
|
93
|
+
)
|
94
|
+
cached_response = TieredCache.get_cached_response(cache_key)
|
95
|
+
if cached_response.is_found:
|
96
|
+
LOGGER.info("Learner Enrollment data found in Cache for Enterprise: [%s]", enterprise_customer_uuid)
|
97
|
+
else:
|
98
|
+
LOGGER.info("Learner Enrollment data not found in Cache for Enterprise: [%s]", enterprise_customer_uuid)
|
99
|
+
TieredCache.set_all_tiers(cache_key, 'dummy_enrollments', DEFAULT_LEARNER_CACHE_TIMEOUT)
|
100
|
+
LOGGER.info("Cache set for Enterprise: [%s] whose key is: [%s]", enterprise_customer_uuid, cache_key)
|
101
|
+
except Exception as e:
|
102
|
+
LOGGER.error("Memcached connection test failed: %s", e)
|
103
|
+
|
95
104
|
enrollments = EnterpriseLearnerEnrollment.objects.filter(enterprise_customer_uuid=enterprise_customer_uuid)
|
96
105
|
enrollments = self.apply_filters(enrollments)
|
97
|
-
|
106
|
+
|
98
107
|
return enrollments
|
99
108
|
|
100
109
|
def list(self, request, *args, **kwargs):
|
File without changes
|
File without changes
|
File without changes
|