Skip to content

Commit

Permalink
fix: Caliper transform of video events without duration
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtcril committed Jun 29, 2023
1 parent faddffc commit 7dcaa05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion event_routing_backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Various backends for receiving edX LMS events..
"""

__version__ = '5.5.0'
__version__ = '5.5.1'

default_app_config = 'event_routing_backends.apps.EventRoutingBackendsConfig' # pylint: disable=invalid-name
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
- edx.video.position.changed
- edx.video.completed (proposed)
"""
from datetime import timedelta

from isodate import duration_isoformat

from event_routing_backends.helpers import convert_seconds_to_iso, make_video_block_id
from event_routing_backends.processors.caliper.registry import CaliperTransformersRegistry
from event_routing_backends.processors.caliper.transformer import CaliperTransformer
Expand Down Expand Up @@ -95,9 +91,9 @@ def get_object(self):
caliper_object.update({
'id': self.get_object_iri('xblock', object_id),
'type': 'VideoObject',
'duration': duration_isoformat(timedelta(
seconds=data.get('duration', 0)
))
'duration': convert_seconds_to_iso(
seconds=data.get('duration', 0)
)
})

return caliper_object
Expand Down

0 comments on commit 7dcaa05

Please sign in to comment.