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