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')
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']))
def contribution(self): return Contribution.get(self._contrib_id)
def _get_event_path(self, data): if not (contrib := Contribution.get(data['contribution_id'])): return []