Пример #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)
Пример #2
0
 def _get_vc_assistance_request_link(self, event, **kwargs):
     from definition import VCAssistanceRequest
     req = Request.find_latest_for_event(event, VCAssistanceRequest.name)
     support_email = VCAssistanceRequestPlugin.settings.get('support_email')
     return render_plugin_template(
         'vc_assistance_request_link.html',
         event=event,
         name=VCAssistanceRequest.name,
         request_accepted=req is not None
         and req.state == RequestState.accepted,
         has_capable_vc_room_attached=has_vc_rooms_attached_to_capable(
             event),
         support_email=support_email)
Пример #3
0
 def _event_updated(self, event, changes, **kwargs):
     req = Request.find_latest_for_event(event, VCAssistanceRequest.name)
     if not req or req.state != RequestState.accepted:
         return
     if 'start_dt' in changes and not start_time_within_working_hours(
             event):
         flash(
             _("The new event start time is out of working hours so videoconference assistance cannot be "
               "provided."), 'warning')
     if 'location_data' in changes and not has_vc_rooms_attached_to_capable(
             event):
         flash(
             _("The new event location doesn't have videoconference capabilities so videoconference "
               "assistance cannot be provided."), 'warning')