Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Caliper transform of video events without duration #315

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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