Пример #1
0
 def _registration_deleted(self, registration, **kwargs):
     """Withdraw CERN access request for deleted registrations."""
     if registration.cern_access_request and not self._is_past_event(
             registration.event):
         if registration.cern_access_request.is_active:
             send_adams_delete_request([registration])
         registration.cern_access_request.request_state = CERNAccessRequestState.withdrawn
Пример #2
0
 def _registration_form_deleted(self, registration_form, **kwargs):
     """
     Withdraw CERN access request for deleted registration form and
     corresponding registrations.
     """
     if (registration_form.cern_access_request and registration_form.cern_access_request.is_active and
             not self._is_past_event(registration_form.event)):
         requests = get_requested_registrations(registration_form.event, regform=registration_form)
         if requests:
             # Notify ADAMS about only requests that it knows about (active)
             active_requests = [r for r in requests if r.is_active]
             send_adams_delete_request(active_requests)
             # Withdraw all requests
             withdraw_access_requests(requests)
             # Notify users who have already got a badge
             notify_access_withdrawn(active_requests)
         registration_form.cern_access_request.request_state = CERNAccessRequestState.withdrawn
Пример #3
0
 def _event_deleted(self, event, **kwargs):
     """
     Withdraw CERN access request for registration forms and corresponding
     registrations of deleted event.
     """
     access_requests_forms = get_requested_forms(event)
     if access_requests_forms and not self._is_past_event(event):
         requests = get_requested_registrations(event=event)
         if requests:
             # Notify ADAMS about only requests that it knows about (active)
             active_requests = [r for r in requests if r.is_active]
             send_adams_delete_request(active_requests)
             # Withdraw all requests
             withdraw_access_requests(requests)
             # Notify users who have already got a badge
             notify_access_withdrawn(active_requests)
         for form in access_requests_forms:
             form.cern_access_request.request_state = CERNAccessRequestState.withdrawn
Пример #4
0
 def _registration_form_deleted(self, registration_form, **kwargs):
     """
     Withdraw CERN access request for deleted registration form and
     corresponding registrations.
     """
     if registration_form.cern_access_request and registration_form.cern_access_request.is_active:
         registrations = get_requested_registrations(
             registration_form.event, regform=registration_form)
         if registrations:
             deleted = send_adams_delete_request(registrations)
             if deleted:
                 withdraw_access_requests(registrations)
                 notify_access_withdrawn(registrations)
         registration_form.cern_access_request.request_state = CERNAccessRequestState.withdrawn
Пример #5
0
 def _event_deleted(self, event, **kwargs):
     """
     Withdraw CERN access request for registration forms and corresponding
     registrations of deleted event.
     """
     access_requests_forms = get_requested_forms(event)
     if access_requests_forms:
         requested_registrations = get_requested_registrations(event=event)
         if requested_registrations:
             deleted = send_adams_delete_request(requested_registrations)
             if deleted:
                 withdraw_access_requests(requested_registrations)
                 notify_access_withdrawn(requested_registrations)
         for form in access_requests_forms:
             form.cern_access_request.request_state = CERNAccessRequestState.withdrawn
Пример #6
0
 def _registration_deleted(self, registration, **kwargs):
     """Withdraw CERN access request for deleted registrations."""
     if registration.cern_access_request:
         send_adams_delete_request([registration])
         registration.cern_access_request.request_state = CERNAccessRequestState.withdrawn