Commit 6ebddd02 by muhammad-ammar

address feedback

parent 47eee6da
...@@ -67,4 +67,4 @@ logs/*/*.log* ...@@ -67,4 +67,4 @@ logs/*/*.log*
venv/ venv/
video-image/ video-images/
...@@ -184,7 +184,7 @@ def update_video_image(edx_video_id, course_id, image_data, file_name): ...@@ -184,7 +184,7 @@ def update_video_image(edx_video_id, course_id, image_data, file_name):
try: try:
course_video = CourseVideo.objects.get(course_id=course_id, video__edx_video_id=edx_video_id) course_video = CourseVideo.objects.get(course_id=course_id, video__edx_video_id=edx_video_id)
except Video.DoesNotExist: except Video.DoesNotExist:
error_message = u"CourseVideo not found for edx_video_id: {0}".format(edx_video_id) error_message = u'CourseVideo not found for edx_video_id: {0}'.format(edx_video_id)
raise ValVideoNotFoundError(error_message) raise ValVideoNotFoundError(error_message)
video_image, _ = VideoImage.create_or_update(course_video, file_name, image_data) video_image, _ = VideoImage.create_or_update(course_video, file_name, image_data)
......
...@@ -186,5 +186,7 @@ VIDEO_IMAGE_SETTINGS = dict( ...@@ -186,5 +186,7 @@ VIDEO_IMAGE_SETTINGS = dict(
# STORAGE_KWARGS=dict(bucket='video-image-bucket'), # STORAGE_KWARGS=dict(bucket='video-image-bucket'),
# If you are changing prefix value then update the .gitignore accordingly # If you are changing prefix value then update the .gitignore accordingly
# so that images created during tests due to upload should be ignored # so that images created during tests due to upload should be ignored
DIRECTORY_PREFIX='video-image/', VIDEO_IMAGE_MAX_BYTES=2097152,
VIDEO_IMAGE_MIN_BYTES=100,
DIRECTORY_PREFIX='video-images/',
) )
...@@ -22,4 +22,6 @@ def get_video_image_storage(): ...@@ -22,4 +22,6 @@ def get_video_image_storage():
settings.VIDEO_IMAGE_SETTINGS.get('STORAGE_CLASS'), settings.VIDEO_IMAGE_SETTINGS.get('STORAGE_CLASS'),
)(**settings.VIDEO_IMAGE_SETTINGS.get('STORAGE_KWARGS', {})) )(**settings.VIDEO_IMAGE_SETTINGS.get('STORAGE_KWARGS', {}))
else: else:
return get_storage_class() # during edx-platform loading this method gets called but settings are not ready yet
# so in that case we will return default(FileSystemStorage) storage class instance
return get_storage_class()()
...@@ -6,5 +6,4 @@ lxml==3.3.6 ...@@ -6,5 +6,4 @@ lxml==3.3.6
-e git+https://github.com/edx/django-rest-framework-oauth.git@f0b503fda8c254a38f97fef802ded4f5fe367f7a#egg=djangorestframework-oauth -e git+https://github.com/edx/django-rest-framework-oauth.git@f0b503fda8c254a38f97fef802ded4f5fe367f7a#egg=djangorestframework-oauth
django-storages==1.5.2 django-storages==1.5.2
boto==2.46.1 boto==2.46.1
Pillow==4.1.0
django-model-utils==2.3.1 django-model-utils==2.3.1
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