Commit a3c54afe by David Ormsbee

API calls return None instead of a blank string for non-existent URLs

parent 8bae0aef
...@@ -186,7 +186,7 @@ def get_urls_for_profiles(edx_video_id, profiles): ...@@ -186,7 +186,7 @@ def get_urls_for_profiles(edx_video_id, profiles):
If the profiles or video is not found, urls will be blank. If the profiles or video is not found, urls will be blank.
""" """
profiles_to_urls = {profile: "" for profile in profiles} profiles_to_urls = {profile: None for profile in profiles}
try: try:
video_info = get_video_info(edx_video_id) video_info = get_video_info(edx_video_id)
except ValVideoNotFoundError: except ValVideoNotFoundError:
...@@ -205,7 +205,7 @@ def get_videos_for_course(course_id): ...@@ -205,7 +205,7 @@ def get_videos_for_course(course_id):
""" """
Returns an iterator of videos for the given course id Returns an iterator of videos for the given course id
""" """
videos = Video.objects.filter(courses__course_id=course_id) videos = Video.objects.filter(courses__course_id=unicode(course_id))
return (VideoSerializer(video).data for video in videos) return (VideoSerializer(video).data for video in videos)
def get_video_info_for_course_and_profile(course_id, profile_name): def get_video_info_for_course_and_profile(course_id, profile_name):
......
...@@ -37,7 +37,7 @@ def load_requirements(*requirements_paths): ...@@ -37,7 +37,7 @@ def load_requirements(*requirements_paths):
setup( setup(
name='edxval', name='edxval',
version='0.0.3', version='0.0.4',
author='edX', author='edX',
url='http://github.com/edx/edx-val', url='http://github.com/edx/edx-val',
description='edx-val', description='edx-val',
......
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