Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/breatheco-de/apiv2
Browse files Browse the repository at this point in the history
  • Loading branch information
alesanchezr committed Dec 13, 2024
2 parents cb893c6 + 01ff54f commit bb31e7d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
24 changes: 24 additions & 0 deletions breathecode/marketing/migrations/0092_coursetranslation_heading.py
Original file line number Diff line number Diff line change
@@ -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,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 5.1.2 on 2024-12-12 14:48

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("marketing", "0092_coursetranslation_heading"),
]

operations = [
migrations.AlterField(
model_name="coursetranslation",
name="heading",
field=models.TextField(
blank=True,
default=None,
help_text="Heading that will be used in the landing page",
max_length=400,
null=True,
),
),
]
3 changes: 3 additions & 0 deletions breathecode/marketing/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.TextField(
max_length=400, 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(
Expand Down
3 changes: 2 additions & 1 deletion breathecode/marketing/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit bb31e7d

Please sign in to comment.