Added lang attribute in LMS and Studio; added language col to course_overviews

Added course level lang attribute for LMS

added lang attribute to Studio

fixed error when trying to get language attribute on course that does not exist

simplified code

added lang attribure to more places in LMS, added migration for language attribute in course_overview

fixing contraints in the database for language attribute

added lang attribute to several more places in LMS and Studio

added lang attribute to discussion and custom pages; cleaned up code

fixed issue that was causing test failures

moved lang attribute higher in tree in two places
This commit is contained in:
Sarah Fischmann
2017-05-31 16:56:46 -04:00
parent 3fbe60ef57
commit eafb79defc
13 changed files with 77 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_overviews', '0012_courseoverview_eligible_for_financial_aid'),
]
operations = [
migrations.AddField(
model_name='courseoverview',
name='language',
field=models.TextField(null=True),
),
]

View File

@@ -101,6 +101,8 @@ class CourseOverview(TimeStampedModel):
marketing_url = TextField(null=True)
eligible_for_financial_aid = BooleanField(default=True)
language = TextField(null=True)
@classmethod
def _create_or_update(cls, course):
"""
@@ -190,6 +192,8 @@ class CourseOverview(TimeStampedModel):
course_overview.course_video_url = CourseDetails.fetch_video_url(course.id)
course_overview.self_paced = course.self_paced
course_overview.language = course.language
return course_overview
@classmethod