Skip to content

Commit

Permalink
Merge pull request #2147 from openedx/sameeramin/ENT-9003-2a
Browse files Browse the repository at this point in the history
refactor: made `career_engagement_network_message` nullable
  • Loading branch information
sameeramin authored Jun 14, 2024
2 parents 76251b5 + ad3f52a commit 9974683
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Unreleased
----------
* nothing unreleased

[4.20.3]
---------
* feat: Makes ``career_engagement_network_message`` field nullable in ``EnterpriseCustomer``.

[4.20.2]
--------
* fix: cancel-fulfillment endpoint is now idempotent
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.20.2"
__version__ = "4.20.3"
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 4.2.10 on 2024-06-13 10:47

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('enterprise', '0211_enterprisecustomer_show_videos_in_learner_portal_search_results_and_more'),
]

operations = [
migrations.AlterField(
model_name='enterprisecustomer',
name='career_engagement_network_message',
field=models.TextField(blank=True, help_text='Message text shown on the learner portal dashboard for career engagement network.', null=True),
),
migrations.AlterField(
model_name='enterprisecustomer',
name='learner_portal_sidebar_content',
field=models.TextField(blank=True, help_text='Text shown on the learner portal dashboard for customer specific purposes. Open HTML field.', null=True),
),
migrations.AlterField(
model_name='historicalenterprisecustomer',
name='career_engagement_network_message',
field=models.TextField(blank=True, help_text='Message text shown on the learner portal dashboard for career engagement network.', null=True),
),
migrations.AlterField(
model_name='historicalenterprisecustomer',
name='learner_portal_sidebar_content',
field=models.TextField(blank=True, help_text='Text shown on the learner portal dashboard for customer specific purposes. Open HTML field.', null=True),
),
]
2 changes: 2 additions & 0 deletions enterprise/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,13 +526,15 @@ class Meta:

career_engagement_network_message = models.TextField(
blank=True,
null=True,
help_text=_(
'Message text shown on the learner portal dashboard for career engagement network.'
),
)

learner_portal_sidebar_content = models.TextField(
blank=True,
null=True,
help_text=_(
'Text shown on the learner portal dashboard for customer specific purposes. Open HTML field.'
),
Expand Down
11 changes: 11 additions & 0 deletions enterprise/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,14 @@ def generate_default_orchestration_record_display_name(sender, instance, **kwarg

if COURSE_UNENROLLMENT_COMPLETED is not None:
COURSE_UNENROLLMENT_COMPLETED.connect(enterprise_unenrollment_receiver)


@receiver(pre_save, sender=models.EnterpriseCustomer)
def copy_data_from_career_engagement_network_message(sender, instance, **kwargs): # pylint: disable=unused-argument
"""
Copy data from `career_engagement_network_message` and `enable_career_engagement_network_on_learner_portal` to
`learner_portal_sidebar_content` and `enable_learner_portal_sidebar_message` respectively.
"""
enable_cen = instance.enable_career_engagement_network_on_learner_portal
instance.learner_portal_sidebar_content = instance.career_engagement_network_message
instance.enable_learner_portal_sidebar_message = enable_cen

0 comments on commit 9974683

Please sign in to comment.