diff --git a/breathecode/marketing/migrations/0092_coursetranslation_heading.py b/breathecode/marketing/migrations/0092_coursetranslation_heading.py new file mode 100644 index 000000000..9ae958395 --- /dev/null +++ b/breathecode/marketing/migrations/0092_coursetranslation_heading.py @@ -0,0 +1,24 @@ +# Generated by Django 5.1.2 on 2024-12-12 14:18 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("marketing", "0091_course_cohorts_order"), + ] + + operations = [ + migrations.AddField( + model_name="coursetranslation", + name="heading", + field=models.CharField( + blank=True, + default=None, + help_text="Heading that will be used in the landing page", + max_length=160, + null=True, + ), + ), + ] diff --git a/breathecode/marketing/models.py b/breathecode/marketing/models.py index 5370aa91a..afea9145f 100644 --- a/breathecode/marketing/models.py +++ b/breathecode/marketing/models.py @@ -867,6 +867,9 @@ class CourseTranslation(models.Model): course = models.ForeignKey(Course, on_delete=models.CASCADE) lang = models.CharField(max_length=5, validators=[validate_language_code]) title = models.CharField(max_length=60) + heading = models.CharField( + max_length=160, help_text="Heading that will be used in the landing page", default=None, null=True, blank=True + ) description = models.TextField(max_length=400) short_description = models.CharField(max_length=120, null=True, default=None, blank=True) video_url = models.URLField( diff --git a/breathecode/marketing/serializers.py b/breathecode/marketing/serializers.py index ff0bafa83..bcbe41d8f 100644 --- a/breathecode/marketing/serializers.py +++ b/breathecode/marketing/serializers.py @@ -2,6 +2,7 @@ import re from datetime import timedelta +from capyc.rest_framework.exceptions import ValidationException from django.db.models.query_utils import Q from django.utils import timezone from rest_framework import serializers @@ -11,7 +12,6 @@ from breathecode.services.activecampaign.client import acp_ids from breathecode.utils import serpy from breathecode.utils.integer_to_base import to_base -from capyc.rest_framework.exceptions import ValidationException from .models import AcademyAlias, ActiveCampaignAcademy, Automation, CourseTranslation, FormEntry, ShortLink, Tag @@ -408,6 +408,7 @@ class GetCourseTranslationSerializer(serpy.Serializer): landing_variables = serpy.Field() landing_url = serpy.Field() video_url = serpy.Field() + heading = serpy.Field() class GetCourseSmallSerializer(serpy.Serializer):