Beispiel #1
0
    def send(cls, req, data):
        check_access(req)
        start_dt = data['start_dt_override'] or req.event.start_dt
        end_dt = data['end_dt_override'] or req.event.end_dt
        if data['start_dt_override']:
            data['start_dt_override'] = data['start_dt_override'].isoformat()
        if data['end_dt_override']:
            data['end_dt_override'] = data['end_dt_override'].isoformat()
        times_changed = False
        if req.id is not None:
            old_start_dt, old_end_dt = get_access_dates(req)
            if old_start_dt != start_dt or old_end_dt != end_dt:
                times_changed = True
        super(CERNAccessRequestDefinition, cls).send(req, data)
        update_access_request(req)
        req.state = RequestState.accepted
        if times_changed:
            handle_event_time_update(req.event)

        link = "https://indico-user-docs.web.cern.ch/indico-user-docs/cern/cern_access/#granting-access-to-participants"
        message = _(
            'Please note that even though your request has been accepted, you still have to '
            'request badges for each one of your participants. {link}More details here.{endlink}'
        ).format(link='<a href="{}">'.format(link), endlink='</a>')
        flash(Markup(message), 'warning')
Beispiel #2
0
 def send(cls, req, data):
     check_access(req)
     start_dt = data['start_dt_override'] or req.event.start_dt
     end_dt = data['end_dt_override'] or req.event.end_dt
     if data['start_dt_override']:
         data['start_dt_override'] = data['start_dt_override'].isoformat()
     if data['end_dt_override']:
         data['end_dt_override'] = data['end_dt_override'].isoformat()
     times_changed = False
     if req.id is not None:
         old_start_dt, old_end_dt = get_access_dates(req)
         if old_start_dt != start_dt or old_end_dt != end_dt:
             times_changed = True
     super(CERNAccessRequestDefinition, cls).send(req, data)
     update_access_request(req)
     req.state = RequestState.accepted
     if times_changed:
         handle_event_time_update(req.event)
Beispiel #3
0
 def _event_time_changed(self, sender, obj, **kwargs):
     """Update event time in CERN access requests in ADaMS."""
     handle_event_time_update(obj)