Skip to content

Commit

Permalink
Merge pull request #1898 from openedx/eahmadjaved/ENT-7533
Browse files Browse the repository at this point in the history
feat: Added enable_source_demo_data_for_analytics_and_lpr field to En…
  • Loading branch information
jajjibhai008 authored Oct 9, 2023
2 parents fb316b8 + 6f37834 commit e31214a
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Change Log
Unreleased
----------
[4.6.0]
-------
feat: Added enable_source_demo_data_for_analytics_and_lpr field to EnterpriseCustomer.

[4.5.7]
-------
fix: Fixed ChatGPT prompt and a few model modifications for better readability for admins.
Expand Down
2 changes: 1 addition & 1 deletion enterprise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Your project description goes here.
"""

__version__ = "4.5.7"
__version__ = "4.6.0"
3 changes: 2 additions & 1 deletion enterprise/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ class EnterpriseCustomerAdmin(DjangoObjectActions, SimpleHistoryAdmin):
'enable_audit_data_reporting', 'enable_learner_portal_offers',
'enable_executive_education_2U_fulfillment',
'enable_career_engagement_network_on_learner_portal',
'career_engagement_network_message', 'enable_pathways', 'enable_programs'),
'career_engagement_network_message', 'enable_pathways', 'enable_programs',
'enable_demo_data_for_analytics_and_lpr'),
'description': ('The following default settings should be the same for '
'the majority of enterprise customers, '
'and are either rarely used, unlikely to be sold, '
Expand Down
1 change: 1 addition & 0 deletions enterprise/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ class Meta:
"career_engagement_network_message",
"enable_pathways",
"enable_programs",
"enable_demo_data_for_analytics_and_lpr",
"enable_analytics_screen",
"enable_portal_reporting_config_screen",
"enable_portal_saml_configuration_screen",
Expand Down
2 changes: 1 addition & 1 deletion enterprise/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class Meta:
'enterprise_customer_catalogs', 'reply_to', 'enterprise_notification_banner', 'hide_labor_market_data',
'modified', 'enable_universal_link', 'enable_browse_and_request', 'admin_users',
'enable_career_engagement_network_on_learner_portal', 'career_engagement_network_message',
'enable_pathways', 'enable_programs',
'enable_pathways', 'enable_programs', 'enable_demo_data_for_analytics_and_lpr',
)

identity_providers = EnterpriseCustomerIdentityProviderSerializer(many=True, read_only=True)
Expand Down
23 changes: 23 additions & 0 deletions enterprise/migrations/0192_auto_20231009_1302.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.20 on 2023-10-09 13:02

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('enterprise', '0191_auto_20231006_0948'),
]

operations = [
migrations.AddField(
model_name='enterprisecustomer',
name='enable_demo_data_for_analytics_and_lpr',
field=models.BooleanField(default=False, help_text='Display Demo data from analyitcs and learner progress report for demo customer.', verbose_name='Enable demo data from analytics and lpr'),
),
migrations.AddField(
model_name='historicalenterprisecustomer',
name='enable_demo_data_for_analytics_and_lpr',
field=models.BooleanField(default=False, help_text='Display Demo data from analyitcs and learner progress report for demo customer.', verbose_name='Enable demo data from analytics and lpr'),
),
]
6 changes: 6 additions & 0 deletions enterprise/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,12 @@ class Meta:
help_text=_("Specifies whether the organization should have access to executive education 2U content.")
)

enable_demo_data_for_analytics_and_lpr = models.BooleanField(
verbose_name="Enable demo data from analytics and lpr",
default=False,
help_text=_("Display Demo data from analyitcs and learner progress report for demo customer.")
)

contact_email = models.EmailField(
verbose_name="Customer admin contact email:",
null=True,
Expand Down
5 changes: 5 additions & 0 deletions tests/test_enterprise/api/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'career_engagement_network_message': 'Test message',
'enable_pathways': True,
'enable_programs': True,
'enable_demo_data_for_analytics_and_lpr': False,
}],
),
(
Expand Down Expand Up @@ -1253,6 +1254,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'career_engagement_network_message': 'Test message',
'enable_pathways': True,
'enable_programs': True,
'enable_demo_data_for_analytics_and_lpr': False,
},
'active': True, 'user_id': 0, 'user': None,
'data_sharing_consent_records': [], 'groups': [],
Expand Down Expand Up @@ -1342,6 +1344,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'career_engagement_network_message': 'Test message',
'enable_pathways': True,
'enable_programs': True,
'enable_demo_data_for_analytics_and_lpr': False,
}],
),
(
Expand Down Expand Up @@ -1407,6 +1410,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'career_engagement_network_message': 'Test message',
'enable_pathways': True,
'enable_programs': True,
'enable_demo_data_for_analytics_and_lpr': False,
}],
),
(
Expand Down Expand Up @@ -1643,6 +1647,7 @@ def test_enterprise_customer_with_access_to(
'career_engagement_network_message': 'Test message',
'enable_pathways': True,
'enable_programs': True,
'enable_demo_data_for_analytics_and_lpr': False,
}
else:
mock_empty_200_success_response = {
Expand Down
1 change: 1 addition & 0 deletions tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def setUp(self):
"sso_orchestration_records",
"enable_pathways",
"enable_programs",
"enable_demo_data_for_analytics_and_lpr",
]
),
(
Expand Down

0 comments on commit e31214a

Please sign in to comment.