Unverified Commit 0e5b8765 by M. Rehan Committed by GitHub

Merge pull request #60 from edx/enable-video-uploads-by-default

Clean Course Model
parents 722e8945 eecf7430
......@@ -20,7 +20,9 @@ class CourseAdmin(admin.ModelAdmin):
'institution',
'edx_classid',
'last_vid_number',
'previous_statechange'
'previous_statechange',
'created',
'modified',
]
list_filter = ['institution']
search_fields = [
......
......@@ -63,7 +63,6 @@
"tp_proc": false,
"c24_proc": false,
"s3_proc": true,
"xue": true,
"local_storedir": "course-v1:VEDA+VEDA201+2015_T1",
"studio_hex": "xxxx"
}
......
......@@ -8,7 +8,7 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('VEDA_OS01', '0002_auto_20171016_1211'),
('VEDA_OS01', '0003_auto_20171019_1317'),
]
operations = [
......
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-11-08 07:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('VEDA_OS01', '0003_auto_20171024_2003'),
]
operations = [
migrations.RemoveField(
model_name='course',
name='mobile_override',
),
migrations.RemoveField(
model_name='course',
name='parent_ID',
),
migrations.RemoveField(
model_name='course',
name='s3_dir',
),
migrations.RemoveField(
model_name='course',
name='xue',
),
migrations.AddField(
model_name='course',
name='created',
field=model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created'),
),
migrations.AddField(
model_name='course',
name='modified',
field=model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified'),
),
migrations.AlterField(
model_name='course',
name='course_hold',
field=models.BooleanField(default=True, help_text=b'Tells whether this course is active.', verbose_name=b'Course Active'),
),
migrations.AlterField(
model_name='course',
name='course_name',
field=models.CharField(help_text=b'Name of this course', max_length=255, verbose_name=b'Course Name'),
),
migrations.AlterField(
model_name='course',
name='edx_classid',
field=models.CharField(help_text=b'Course number to identify the course.', max_length=255, verbose_name=b'Class ID'),
),
migrations.AlterField(
model_name='course',
name='institution',
field=models.CharField(help_text=b'Organization of the course.', max_length=50, verbose_name=b'Inst. Code'),
),
]
......@@ -229,24 +229,32 @@ class Institution(models.Model):
)
class Course(models.Model):
class Course(TimeStampedModel):
"""
Model for Course.
Model to contain Studio course runs. Ideally, there should be one entry
in this Model for all the course runs in Studio.
"""
course_name = models.CharField('Course Name', max_length=100)
course_name = models.CharField('Course Name', help_text='Name of this course', max_length=255)
# TODO: Change Name (this is reversed)
course_hold = models.BooleanField('Course Active', default=False)
institution = models.CharField('Inst. Code', max_length=4)
edx_classid = models.CharField('Class ID', max_length=5)
course_hold = models.BooleanField(
'Course Active',
help_text='Tells whether this course is active.',
default=True
)
institution = models.CharField(
'Inst. Code',
help_text='Organization of the course.',
max_length=50
)
edx_classid = models.CharField(
'Class ID',
help_text='Course number to identify the course.',
max_length=255
)
# TODO: Create Default for 'this year' (e.g. 2017)
# TODO deprecate semesterid.
semesterid = models.CharField('Semester', max_length=4)
parent_ID = models.CharField(
'Parent Project',
max_length=8,
null=True, blank=True
)
previous_statechange = models.DateTimeField(
'Previous Data Statechange',
null=True, blank=True
......@@ -357,21 +365,6 @@ class Course(models.Model):
# TODO: Change field name
s3_proc = models.BooleanField('Process for AWS S3/Mobile?', default=True)
# TODO: Deprecate (HLS) Replace
mobile_override = models.BooleanField(
'Low Bandwidth Override',
default=False
)
# TODO: Deprecate
s3_dir = models.CharField(
'S3 Directory',
max_length=50,
null=True, blank=True
)
# TODO: Change field name
xue = models.BooleanField('Submit to VAL', default=False)
# TODO: Change field name
local_storedir = models.CharField(
'edX Studio URL (VAL)',
......
......@@ -15,7 +15,6 @@ class CourseSerializer(serializers.ModelSerializer):
'review_proc',
'yt_proc',
's3_proc',
'mobile_override',
'course_name',
'institution',
'edx_classid',
......@@ -24,7 +23,9 @@ class CourseSerializer(serializers.ModelSerializer):
'previous_statechange',
'studio_hex',
'proc_loc',
'sg_projID'
'sg_projID',
'created',
'modified',
)
def create(self, validated_data, partial=True):
......
......@@ -361,8 +361,7 @@ class VedaDelivery:
For now, old style workflow with checks and deletes at end
"""
if self.video_query.inst_class.s3_proc is False and \
self.video_query.inst_class.mobile_override is False:
if not self.video_query.inst_class.s3_proc:
return False
if self.video_proto.filesize < self.auth_dict['multi_upload_barrier']:
......
......@@ -70,13 +70,10 @@ class VedaEncode(object):
self.encode_list.add(e)
return None
if self.course_object.mobile_override is True:
for e in self.encode_dict['mobile_override']:
self.encode_list.add(e)
return None
for key, entry in self.encode_dict.iteritems():
if getattr(self.course_object, key) is True:
# Adding default to avoid AttributeError on trying to get
# `mobile_override`, it is currently in `encode_dict`.
if getattr(self.course_object, key, False) is True:
if key != 'review_proc':
for e in entry:
self.encode_list.add(e)
......
......@@ -267,7 +267,6 @@ class VEDACat():
setattr(c1, 'tp_proc', False)
"""Always Set"""
setattr(c1, 'xue', True)
setattr(c1, 'course_hold', True) # Remember, this is reversed
# Semester
......
......@@ -10,22 +10,21 @@ models_nottoget:
- last_vid_number
- previous_statechange
- yt_proc
- s3_dir
- studio_hex
- sg_projID
- c24_hours
- created
- modified
#boolean (checkbox)
bools:
- course_hold
- proc_loc
- review_proc
- mobile_override
- yt_proc
- tp_proc
- c24_proc
- s3_proc
- xue
# dropdown boxes
dropdowns:
......@@ -47,14 +46,11 @@ organizational:
institution: main
institution_name: main
edx_classid: main
parent_ID: main
yt_proc: encode
s3_proc: encode
mobile_override: encode
review_proc: encode
proc_loc: encode
xue: encode
yt_logon: encode
tp_proc: transcribe
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment