def update_data_vc_room(self, vc_room, data, is_new=False):
        super(RedirectorPlugin, self).update_data_vc_room(vc_room, data)

        for key in ['room_url_base']:
            if key in data:
                vc_room.data[key] = data.pop(key)
                contrib = Contribution.get(data['contribution'])
                cid = contrib.id if contrib else 0
                vc_room.data['room_url'] = url_for_plugin(
                    'vc_redirector.vc_redirect', contrib_id=cid)

        flag_modified(vc_room, 'data')
예제 #2
0
def obj_deref(ref):
    """Returns the object identified by `ref`"""
    from indico_livesync.models.queue import EntryType
    if ref['type'] == EntryType.category:
        return CategoryManager().getById(ref['category_id'], True)
    elif ref['type'] == EntryType.event:
        return Event.get(ref['event_id'])
    elif ref['type'] == EntryType.contribution:
        return Contribution.get(ref['contrib_id'])
    elif ref['type'] == EntryType.subcontribution:
        return SubContribution.get(ref['subcontrib_id'])
    else:
        raise ValueError('Unexpected object type: {}'.format(ref['type']))
예제 #3
0
파일: legacy.py 프로젝트: wtakase/indico
 def contribution(self):
     return Contribution.get(self._contrib_id)
예제 #4
0
 def _get_event_path(self, data):
     if not (contrib := Contribution.get(data['contribution_id'])):
         return []
예제 #5
0
 def contribution(self):
     return Contribution.get(self._contrib_id)