Skip to content

Commit 2c347ae

Browse files
authored
Add ContractPage welcome message (#3059)
1 parent b3d44f6 commit 2c347ae

File tree

7 files changed

+71
-0
lines changed

7 files changed

+71
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Generated by Django 4.2.25 on 2025-10-31 19:55
2+
3+
import wagtail.fields
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
dependencies = [
9+
("b2b", "0011_sync_contract_type_fields"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="contractpage",
15+
name="welcome_message",
16+
field=models.CharField(
17+
blank=True, help_text="A welcome message for learners.", max_length=255
18+
),
19+
),
20+
migrations.AddField(
21+
model_name="contractpage",
22+
name="welcome_message_extra",
23+
field=wagtail.fields.RichTextField(
24+
blank=True, help_text="Additional welcome message content for learners."
25+
),
26+
),
27+
]

b2b/models.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ class ContractPage(Page):
197197
description = RichTextField(
198198
blank=True, help_text="Any useful extra information about the contract."
199199
)
200+
welcome_message = models.CharField(
201+
max_length=255, blank=True, help_text="A welcome message for learners."
202+
)
203+
welcome_message_extra = RichTextField(
204+
blank=True, help_text="Additional welcome message content for learners."
205+
)
200206
integration_type = models.CharField(
201207
max_length=255,
202208
choices=CONTRACT_MEMBERSHIP_CHOICES,
@@ -253,6 +259,8 @@ class ContractPage(Page):
253259
MultiFieldPanel(
254260
[
255261
FieldPanel("description"),
262+
FieldPanel("welcome_message"),
263+
FieldPanel("welcome_message_extra"),
256264
FieldPanel("organization"),
257265
],
258266
heading="Basic Information",

b2b/serializers/v0/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class Meta:
2121
"id",
2222
"name",
2323
"description",
24+
"welcome_message",
25+
"welcome_message_extra",
2426
"integration_type",
2527
"membership_type",
2628
"organization",
@@ -34,6 +36,8 @@ class Meta:
3436
"id",
3537
"name",
3638
"description",
39+
"welcome_message",
40+
"welcome_message_extra",
3741
"integration_type",
3842
"membership_type",
3943
"organization",

openapi/specs/v0.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,14 @@ components:
15151515
type: string
15161516
readOnly: true
15171517
description: Any useful extra information about the contract.
1518+
welcome_message:
1519+
type: string
1520+
readOnly: true
1521+
description: A welcome message for learners.
1522+
welcome_message_extra:
1523+
type: string
1524+
readOnly: true
1525+
description: Additional welcome message content for learners.
15181526
integration_type:
15191527
allOf:
15201528
- $ref: '#/components/schemas/IntegrationTypeEnum'
@@ -1565,6 +1573,8 @@ components:
15651573
- name
15661574
- organization
15671575
- slug
1576+
- welcome_message
1577+
- welcome_message_extra
15681578
Country:
15691579
type: object
15701580
description: Serializer for pycountry countries, with states for US/CA

openapi/specs/v1.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,14 @@ components:
15151515
type: string
15161516
readOnly: true
15171517
description: Any useful extra information about the contract.
1518+
welcome_message:
1519+
type: string
1520+
readOnly: true
1521+
description: A welcome message for learners.
1522+
welcome_message_extra:
1523+
type: string
1524+
readOnly: true
1525+
description: Additional welcome message content for learners.
15181526
integration_type:
15191527
allOf:
15201528
- $ref: '#/components/schemas/IntegrationTypeEnum'
@@ -1565,6 +1573,8 @@ components:
15651573
- name
15661574
- organization
15671575
- slug
1576+
- welcome_message
1577+
- welcome_message_extra
15681578
Country:
15691579
type: object
15701580
description: Serializer for pycountry countries, with states for US/CA

openapi/specs/v2.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,14 @@ components:
15151515
type: string
15161516
readOnly: true
15171517
description: Any useful extra information about the contract.
1518+
welcome_message:
1519+
type: string
1520+
readOnly: true
1521+
description: A welcome message for learners.
1522+
welcome_message_extra:
1523+
type: string
1524+
readOnly: true
1525+
description: Additional welcome message content for learners.
15181526
integration_type:
15191527
allOf:
15201528
- $ref: '#/components/schemas/IntegrationTypeEnum'
@@ -1565,6 +1573,8 @@ components:
15651573
- name
15661574
- organization
15671575
- slug
1576+
- welcome_message
1577+
- welcome_message_extra
15681578
Country:
15691579
type: object
15701580
description: Serializer for pycountry countries, with states for US/CA

users/views_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ def test_get_user_by_me(mocker, client, user, is_anonymous, has_orgs):
7373
"id": contract.id,
7474
"name": contract.name,
7575
"description": contract.description,
76+
"welcome_message": contract.welcome_message,
77+
"welcome_message_extra": contract.welcome_message_extra,
7678
"membership_type": contract.membership_type,
7779
"integration_type": contract.integration_type,
7880
"contract_start": None,

0 commit comments

Comments
 (0)