Example #1
0
 def render_form(cls, event, **kwargs):
     from indico_vc_assistance.plugin import VCAssistanceRequestPlugin
     req = kwargs['req']
     kwargs['user_authorized'] = can_request_assistance(session.user)
     kwargs['has_vc_capable_rooms'] = has_vc_capable_rooms(event)
     kwargs['has_vc_rooms'] = has_vc_rooms(event)
     kwargs['has_vc_rooms_attached_to_capable'] = has_vc_rooms_attached_to_capable(event)
     kwargs['request_accepted'] = req is not None and req.state == RequestState.accepted
     kwargs['within_working_hours'] = start_time_within_working_hours(event)
     kwargs['support_email'] = VCAssistanceRequestPlugin.settings.get('support_email')
     return super().render_form(event, **kwargs)
 def send(cls, req, data):
     if not can_request_assistance(session.user):
         raise Forbidden
     super(VCAssistanceRequest, cls).send(req, data)
     req.state = RequestState.accepted