From b689d19becf4653c4abf694695607667e500a089 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Wed, 19 Dec 2012 11:11:14 -0500 Subject: [PATCH] Ensure empty video string deletes the video record and doesn't create a partial descriptor. Use 400 not the contrived 515 for malformed html. --- cms/djangoapps/contentstore/views.py | 2 +- cms/djangoapps/models/settings/course_details.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 8705fc2bc6..3e24655a4a 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -986,7 +986,7 @@ def course_info_updates(request, org, course, provided_id=None): try: return HttpResponse(json.dumps(update_course_updates(location, request.POST, provided_id)), mimetype="application/json") except etree.XMLSyntaxError: - return HttpResponse("Failed to save: malformed html", status=515, content_type="text/plain") + return HttpResponseBadRequest("Failed to save: malformed html", content_type="text/plain") @expect_json diff --git a/cms/djangoapps/models/settings/course_details.py b/cms/djangoapps/models/settings/course_details.py index a2d93ffd97..2bb9d98be7 100644 --- a/cms/djangoapps/models/settings/course_details.py +++ b/cms/djangoapps/models/settings/course_details.py @@ -163,8 +163,10 @@ class CourseDetails: def recompose_video_tag(video_key): # TODO should this use a mako template? Of course, my hope is that this is a short-term workaround for the db not storing # the right thing - result = '' + result = None + if video_key: + result = '' return result