Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions cms/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,6 @@ def get_optional_placeholder_values_for_courseware_type(
# Might make sense to use faker for some of this or allow selection of values from different presets
# For now though, this sets up a page which is reasonably complete and can be immediately published
values = {
"price": [
(
"price_details",
{
"text": "PLACEHOLDER - Three easy payments of 99.99",
"link": "https://example.com/pricing",
},
)
],
"min_weeks": 1,
"max_weeks": 1,
"effort": "PLACEHOLDER - 1-2 hours per week",
Expand Down
15 changes: 0 additions & 15 deletions cms/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@ class ResourceBlock(blocks.StructBlock):
detail = blocks.RichTextBlock()


class PriceBlock(blocks.StructBlock):
"""
A custom block for price field.
"""

text = blocks.CharBlock(
max_length=150,
help="Displayed over the product detail page under the price tile.",
)
link = blocks.URLBlock(
required=False,
help="Specify the URL to redirect the user for the product's price details page.",
)


class CourseRunFieldBlock(blocks.FieldBlock):
"""
Block class that allows selecting a course run
Expand Down
20 changes: 20 additions & 0 deletions cms/migrations/0062_remove_productpage_price.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 5.1.15 on 2026-05-12

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("cms", "0061_programpage_list_price"),
]

operations = [
migrations.RemoveField(
model_name="coursepage",
name="price",
),
migrations.RemoveField(
model_name="programpage",
name="price",
),
]
9 changes: 0 additions & 9 deletions cms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@

from cms.blocks import (
CourseRunCertificateOverrides,
PriceBlock,
ResourceBlock,
validate_unique_readable_ids,
)
Expand Down Expand Up @@ -1113,12 +1112,6 @@ class Meta:
help_text="A short description indicating how much effort is required (e.g. 1-3 hours per week).",
)

price = StreamField(
StreamBlock([("price_details", PriceBlock())], max_num=1),
help_text="Specify the product price details.",
use_json_field=True,
)

min_price = models.SmallIntegerField(
default=0,
null=False,
Expand Down Expand Up @@ -1226,7 +1219,6 @@ class Meta:
FieldPanel("max_weekly_hours"),
FieldPanel("min_weeks"),
FieldPanel("max_weeks"),
FieldPanel("price"),
FieldPanel("min_price"),
FieldPanel("max_price"),
FieldPanel("prerequisites"),
Expand Down Expand Up @@ -1284,7 +1276,6 @@ class Meta:
APIField("max_weekly_hours"),
APIField("min_weeks"),
APIField("max_weeks"),
APIField("price"),
APIField("min_price"),
APIField("max_price"),
APIField("prerequisites", serializer=RichTextSerializer()),
Expand Down
11 changes: 0 additions & 11 deletions cms/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ class ProgramPageSerializer(serializers.ModelSerializer):

feature_image_src = serializers.SerializerMethodField()
page_url = serializers.SerializerMethodField()
price = serializers.SerializerMethodField()
list_price = serializers.SerializerMethodField()
financial_assistance_form_url = serializers.SerializerMethodField()
description = serializers.SerializerMethodField()
Expand Down Expand Up @@ -288,15 +287,6 @@ def get_description(self, instance):
return bleach.clean(instance.description, tags={}, strip=True)
return ""

@extend_schema_field(str)
def get_price(self, instance):
"""Get the price text from the program page."""
if hasattr(instance, "price") and instance.price:
return (
instance.price[0].value.get("text") if len(instance.price) > 0 else None
)
return None

@extend_schema_field(serializers.DecimalField(max_digits=10, decimal_places=2))
def get_list_price(self, instance):
"""Get the page list price or fall back to the linked program product price."""
Expand Down Expand Up @@ -389,7 +379,6 @@ class Meta:
"include_in_learn_catalog",
"length",
"effort",
"price",
"list_price",
]

Expand Down
5 changes: 0 additions & 5 deletions cms/serializers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ def test_serialize_program_page(
"live": True,
"length": program_page.length,
"effort": program_page.effort,
"price": None,
"list_price": 99.99,
"include_in_learn_catalog": False,
},
Expand Down Expand Up @@ -463,7 +462,6 @@ def test_serialize_program_page__form_child_of_course_with_program_fk(
"live": True,
"length": program_page.length,
"effort": program_page.effort,
"price": None,
"list_price": None,
"include_in_learn_catalog": False,
},
Expand Down Expand Up @@ -503,7 +501,6 @@ def test_serialize_program_page__with_related_financial_form(
"live": True,
"length": program_page.length,
"effort": program_page.effort,
"price": None,
"list_price": None,
"include_in_learn_catalog": False,
},
Expand Down Expand Up @@ -537,7 +534,6 @@ def test_serialize_program_page__no_financial_form(
"live": True,
"length": program_page.length,
"effort": program_page.effort,
"price": None,
"list_price": None,
"include_in_learn_catalog": False,
},
Expand Down Expand Up @@ -574,7 +570,6 @@ def test_serialize_program_page__with_related_program_no_financial_form(
"live": True,
"length": program_page.length,
"effort": program_page.effort,
"price": None,
"list_price": None,
"include_in_learn_catalog": False,
},
Expand Down
6 changes: 3 additions & 3 deletions drf_lint_baseline.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
"cms/serializers.py:114:16:ORM001",
"cms/serializers.py:153:41:ORM001",
"cms/serializers.py:320:12:ORM001",
"cms/serializers.py:355:20:ORM001",
"cms/serializers.py:366:39:ORM001",
"cms/serializers.py:310:12:ORM001",
"cms/serializers.py:345:20:ORM001",
"cms/serializers.py:356:39:ORM001",
"cms/serializers.py:83:12:ORM001",
"cms/serializers.py:96:12:ORM001",
"courses/serializers/base.py:53:16:ORM001",
Expand Down
5 changes: 0 additions & 5 deletions openapi/specs/v0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7114,10 +7114,6 @@ components:
description: A short description indicating how much effort is required
(e.g. 1-3 hours per week).
maxLength: 100
price:
type: string
description: Get the price text from the program page.
readOnly: true
list_price:
type: string
format: decimal
Expand All @@ -7130,7 +7126,6 @@ components:
- list_price
- live
- page_url
- price
ProgramPageItem:
type: object
description: Serializer for individual program page items, including all relevant
Expand Down
5 changes: 0 additions & 5 deletions openapi/specs/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7114,10 +7114,6 @@ components:
description: A short description indicating how much effort is required
(e.g. 1-3 hours per week).
maxLength: 100
price:
type: string
description: Get the price text from the program page.
readOnly: true
list_price:
type: string
format: decimal
Expand All @@ -7130,7 +7126,6 @@ components:
- list_price
- live
- page_url
- price
ProgramPageItem:
type: object
description: Serializer for individual program page items, including all relevant
Expand Down
5 changes: 0 additions & 5 deletions openapi/specs/v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7114,10 +7114,6 @@ components:
description: A short description indicating how much effort is required
(e.g. 1-3 hours per week).
maxLength: 100
price:
type: string
description: Get the price text from the program page.
readOnly: true
list_price:
type: string
format: decimal
Expand All @@ -7130,7 +7126,6 @@ components:
- list_price
- live
- page_url
- price
ProgramPageItem:
type: object
description: Serializer for individual program page items, including all relevant
Expand Down
Loading