Skip to content

Commit

Permalink
Merge pull request #1904 from openedx/asaeed/ENT-7724
Browse files Browse the repository at this point in the history
[ENT-7724] feat: implement a disable subject metadata transmission flag for cornerstone …
  • Loading branch information
justEhmadSaeed authored Oct 10, 2023
2 parents e31214a + cfd5544 commit 99a4958
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
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.1]
-------
feat: Added the disable_subject_metadata_transmission flag to CornerstoneEnterpriseCustomerConfiguration.

[4.6.0]
-------
feat: Added enable_source_demo_data_for_analytics_and_lpr field to EnterpriseCustomer.
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.6.0"
__version__ = "4.6.1"
2 changes: 2 additions & 0 deletions integrated_channels/cornerstone/exporters/content_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ def transform_subjects(self, content_metadata_item):
"""
Return the transformed version of the course subject list or default value if no subject found.
"""
if self.enterprise_configuration.disable_subject_metadata_transmission:
return None
subjects = []
course_subjects = get_subjects_from_content_metadata(content_metadata_item)
CornerstoneGlobalConfiguration = apps.get_model(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.21 on 2023-10-10 16:54

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('cornerstone', '0029_alter_historicalcornerstoneenterprisecustomerconfiguration_options'),
]

operations = [
migrations.AddField(
model_name='cornerstoneenterprisecustomerconfiguration',
name='disable_subject_metadata_transmission',
field=models.BooleanField(default=False, help_text='If checked, subjects will not be sent to Cornerstone', verbose_name='Disable Subject Content Metadata Transmission'),
),
migrations.AddField(
model_name='historicalcornerstoneenterprisecustomerconfiguration',
name='disable_subject_metadata_transmission',
field=models.BooleanField(default=False, help_text='If checked, subjects will not be sent to Cornerstone', verbose_name='Disable Subject Content Metadata Transmission'),
),
]
8 changes: 8 additions & 0 deletions integrated_channels/cornerstone/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ class CornerstoneEnterpriseCustomerConfiguration(EnterpriseCustomerPluginConfigu
)
)

disable_subject_metadata_transmission = models.BooleanField(
default=False,
verbose_name="Disable Subject Content Metadata Transmission",
help_text=_(
"If checked, subjects will not be sent to Cornerstone"
)
)

history = HistoricalRecords()

class Meta:
Expand Down

0 comments on commit 99a4958

Please sign in to comment.