diff --git a/vc_vidyo/indico_vc_vidyo/blueprint.py b/vc_vidyo/indico_vc_vidyo/blueprint.py
index 1617a5d..c456817 100644
--- a/vc_vidyo/indico_vc_vidyo/blueprint.py
+++ b/vc_vidyo/indico_vc_vidyo/blueprint.py
@@ -14,6 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see .
+from __future__ import unicode_literals
+
from indico.core.plugins import IndicoPluginBlueprint
from indico_vc_vidyo.controllers import RHVidyoRoomOwner
diff --git a/vc_vidyo/indico_vc_vidyo/cli.py b/vc_vidyo/indico_vc_vidyo/cli.py
index 3140bf2..fa194a6 100644
--- a/vc_vidyo/indico_vc_vidyo/cli.py
+++ b/vc_vidyo/indico_vc_vidyo/cli.py
@@ -16,9 +16,6 @@
from __future__ import unicode_literals
-import sys
-from dateutil import rrule
-
from flask_script import Manager
from terminaltables import AsciiTable
diff --git a/vc_vidyo/indico_vc_vidyo/controllers.py b/vc_vidyo/indico_vc_vidyo/controllers.py
index 8beee4a..a02140a 100644
--- a/vc_vidyo/indico_vc_vidyo/controllers.py
+++ b/vc_vidyo/indico_vc_vidyo/controllers.py
@@ -14,6 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see .
+from __future__ import unicode_literals
+
import transaction
from flask import flash, jsonify, session
diff --git a/vc_vidyo/indico_vc_vidyo/plugin.py b/vc_vidyo/indico_vc_vidyo/plugin.py
index 089c0aa..6196e53 100644
--- a/vc_vidyo/indico_vc_vidyo/plugin.py
+++ b/vc_vidyo/indico_vc_vidyo/plugin.py
@@ -154,8 +154,8 @@ class VidyoPlugin(VCPluginMixin, IndicoPlugin):
defined in Vidyo plugin's settings, in that order.
:param vc_room: VCRoom -- The VC room from which to create the Vidyo
- room
- :param event: Conference -- The event to the Vidyo room will be attached
+ room
+ :param event: Event -- The event to the Vidyo room will be attached
"""
client = AdminClient(self.settings)
owner = retrieve_principal(vc_room.data['owner'], allow_groups=False, legacy=False)
diff --git a/vc_vidyo/indico_vc_vidyo/task.py b/vc_vidyo/indico_vc_vidyo/task.py
index dbebc74..ce71b5c 100644
--- a/vc_vidyo/indico_vc_vidyo/task.py
+++ b/vc_vidyo/indico_vc_vidyo/task.py
@@ -39,8 +39,8 @@ def find_old_vidyo_rooms(max_room_event_age):
recently_used = (db.session.query(VCRoom.id)
.filter(VCRoom.type == 'vidyo',
Event.end_dt > (now_utc() - timedelta(days=max_room_event_age)))
- .join(VCRoomEventAssociation)
- .join(Event)
+ .join(VCRoom.events)
+ .join(VCRoomEventAssociation.event_new)
.group_by(VCRoom.id))
# non-deleted rooms with no recent associations
diff --git a/vc_vidyo/indico_vc_vidyo/templates/buttons.html b/vc_vidyo/indico_vc_vidyo/templates/buttons.html
index 706fc2e..6cc0eb5 100644
--- a/vc_vidyo/indico_vc_vidyo/templates/buttons.html
+++ b/vc_vidyo/indico_vc_vidyo/templates/buttons.html
@@ -1,5 +1,5 @@
{% macro render_make_me_owner(event, vc_room, event_vc_room, extra_classes='') %}
- {% if session.user != vc_room.vidyo_extension.owned_by_user and event.as_event.can_manage(session.user) %}
+ {% if session.user != vc_room.vidyo_extension.owned_by_user and event.can_manage(session.user) %}
-
diff --git a/vc_vidyo/indico_vc_vidyo/templates/manage_event_info_box.html b/vc_vidyo/indico_vc_vidyo/templates/manage_event_info_box.html
index bd2b0b7..4a00487 100644
--- a/vc_vidyo/indico_vc_vidyo/templates/manage_event_info_box.html
+++ b/vc_vidyo/indico_vc_vidyo/templates/manage_event_info_box.html
@@ -23,9 +23,9 @@
{% elif event_vc_room.link_type.name == 'event' %}
{% trans %}the whole event{% endtrans %}
{% elif event_vc_room.link_type.name == 'contribution' %}
- {% trans %}Contribution{% endtrans %}: {{ obj.getTitle() }}
+ {% trans %}Contribution{% endtrans %}: {{ obj.title }}
{% elif event_vc_room.link_type.name == 'block' %}
- {% trans %}Session{% endtrans %}: {{ obj.getFullTitle() }}
+ {% trans %}Session{% endtrans %}: {{ obj.full_title }}
{% endif %}
{% if vc_room.data.room_pin %}
diff --git a/vc_vidyo/indico_vc_vidyo/templates/management_buttons.html b/vc_vidyo/indico_vc_vidyo/templates/management_buttons.html
index cfd9cf0..0062cab 100644
--- a/vc_vidyo/indico_vc_vidyo/templates/management_buttons.html
+++ b/vc_vidyo/indico_vc_vidyo/templates/management_buttons.html
@@ -3,5 +3,5 @@
{% block buttons %}
{{ render_join_button(vc_room, extra_classes="icon-play") }}
- {{ render_make_me_owner(event_vc_room.event, vc_room, event_vc_room) }}
+ {{ render_make_me_owner(event_vc_room.event_new, vc_room, event_vc_room) }}
{% endblock %}
diff --git a/vc_vidyo/tests/task_test.py b/vc_vidyo/tests/task_test.py
index 31e2bd7..c2c74f4 100644
--- a/vc_vidyo/tests/task_test.py
+++ b/vc_vidyo/tests/task_test.py
@@ -24,19 +24,6 @@ from indico.modules.vc.models.vc_rooms import VCRoom, VCRoomEventAssociation, VC
from indico_vc_vidyo.models.vidyo_extensions import VidyoExtension
-class DummyEvent(object):
- def __init__(self, id_, title, end_date):
- self.id = id_
- self.title = title
- self.end_date = end_date
-
- def getEndDate(self):
- return self.end_date
-
- def getId(self):
- return self.id
-
-
@pytest.fixture
def create_dummy_room(db, dummy_avatar):
"""Returns a callable which lets you create dummy Vidyo room occurrences"""
@@ -66,11 +53,12 @@ def test_room_cleanup(create_event, create_dummy_room, dummy_avatar, freeze_time
"""Test that 'old' Vidyo rooms are correctly detected"""
freeze_time(datetime(2015, 2, 1))
+ events = {}
for id_, (evt_name, end_date) in enumerate((('Event one', datetime(2012, 1, 1, tzinfo=utc)),
('Event two', datetime(2013, 1, 1, tzinfo=utc)),
('Event three', datetime(2014, 1, 1, tzinfo=utc)),
('Event four', datetime(2015, 1, 1, tzinfo=utc))), start=1):
- create_event(id_, title=evt_name, end_dt=end_date, start_dt=end_date)
+ events[id_] = create_event(id_, title=evt_name, end_dt=end_date, start_dt=end_date)
for id_, (vidyo_id, extension, evt_ids) in enumerate(((1234, 5678, (1, 2, 3, 4)),
(1235, 5679, (1, 2)),
@@ -81,7 +69,7 @@ def test_room_cleanup(create_event, create_dummy_room, dummy_avatar, freeze_time
'vidyo_id': vidyo_id
})
for evt_id in evt_ids:
- VCRoomEventAssociation(vc_room=room, event_id=evt_id, link_type=VCRoomLinkType.event)
+ VCRoomEventAssociation(vc_room=room, linked_event=events[evt_id])
db.session.flush()
from indico_vc_vidyo.task import find_old_vidyo_rooms