Skip to content

Commit

Permalink
chore: add description fields in oc and degree exports (#4467)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-56 authored Oct 15, 2024
1 parent 2065a4f commit a05543f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Command(BaseCommand):

CATALOG_CSV_HEADERS = [
'UUID', 'Title', 'Organizations Name', 'Organizations Logo', 'Organizations Abbr', 'Languages',
'Subjects', 'Subjects Spanish', 'Marketing URL', 'Marketing Image'
'Subjects', 'Subjects Spanish', 'Marketing URL', 'Marketing Image', 'Short Description', 'Full Description'
]

def add_arguments(self, parser):
Expand Down Expand Up @@ -162,6 +162,8 @@ def get_transformed_data(self, product, product_type):
),
"Languages": product.languages_codes(),
"Marketing Image": product.image.url if product.image else "",
"Short Description": product.short_description,
"Full Description": product.full_description,
})
elif product_type == 'degree':
data.update({
Expand All @@ -172,6 +174,8 @@ def get_transformed_data(self, product, product_type):
),
"Languages": ", ".join(language.code for language in product.active_languages) or 'en-us',
"Marketing Image": product.card_image.url if product.card_image else "",
"Short Description": product.subtitle,
"Full Description": product.overview,
})

return data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ def test_get_transformed_data(self):
),
"Marketing URL": product.marketing_url,
"Marketing Image": (product.image.url if product.image else ""),
"Short Description": product.short_description,
"Full Description": product.full_description,
}

def test_get_transformed_data_for_degree(self):
Expand Down Expand Up @@ -538,6 +540,8 @@ def test_get_transformed_data_for_degree(self):
),
"Marketing URL": product.marketing_url,
"Marketing Image": product.card_image.url if product.card_image else "",
"Short Description": product.subtitle,
"Full Description": product.overview,
}

@mock.patch('course_discovery.apps.course_metadata.management.commands.populate_product_catalog.GspreadClient')
Expand Down

0 comments on commit a05543f

Please sign in to comment.