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
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
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
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