Disallow NaN value for speed key.
The VideoBlock `handle_ajax` is allowing NaN values for speed key and causing videos to not load. Also added a data migration to fix the data for learners. PROD-1148
This commit is contained in:
@@ -8,6 +8,7 @@ StudioViewHandlers are handlers for video descriptor instance.
|
||||
|
||||
import json
|
||||
import logging
|
||||
import math
|
||||
|
||||
import six
|
||||
from django.core.files.base import ContentFile
|
||||
@@ -89,6 +90,11 @@ class VideoStudentViewHandlers(object):
|
||||
if key == 'bumper_last_view_date':
|
||||
value = now()
|
||||
|
||||
if key == 'speed' and math.isnan(value):
|
||||
message = u"Invalid speed value {}, must be a float.".format(value)
|
||||
log.warning(message)
|
||||
return json.dumps({'success': False, 'error': message})
|
||||
|
||||
setattr(self, key, value)
|
||||
|
||||
if key == 'speed':
|
||||
|
||||
Reference in New Issue
Block a user