Merge pull request #23205 from edx/dcs/fix-tabs
Add url_slug to the CourseOverviewTab, to support serializing StaticTabs
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.28 on 2020-02-26 15:53
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('course_overviews', '0019_improve_courseoverviewtab'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='courseoverviewtab',
|
||||
name='url_slug',
|
||||
field=models.TextField(null=True),
|
||||
),
|
||||
]
|
||||
@@ -59,7 +59,7 @@ class CourseOverview(TimeStampedModel):
|
||||
app_label = 'course_overviews'
|
||||
|
||||
# IMPORTANT: Bump this whenever you modify this model and/or add a migration.
|
||||
VERSION = 8
|
||||
VERSION = 9
|
||||
|
||||
# Cache entry versioning.
|
||||
version = IntegerField()
|
||||
@@ -257,6 +257,7 @@ class CourseOverview(TimeStampedModel):
|
||||
type=tab.type,
|
||||
name=tab.name,
|
||||
course_staff_only=tab.course_staff_only,
|
||||
url_slug=tab.get('url_slug'),
|
||||
course_overview=course_overview)
|
||||
for tab in course.tabs
|
||||
])
|
||||
@@ -822,6 +823,7 @@ class CourseOverviewTab(models.Model):
|
||||
type = models.CharField(max_length=50, null=True)
|
||||
name = models.TextField(null=True)
|
||||
course_staff_only = models.BooleanField(default=False)
|
||||
url_slug = models.TextField(null=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.tab_id
|
||||
|
||||
Reference in New Issue
Block a user