Skip to content

Commit

Permalink
CERNAccess: Do not email users about past event deletion
Browse files Browse the repository at this point in the history
It's just annoying to tell people an already-expired visitor badge has
been withdrawn...
  • Loading branch information
ThiefMaster committed Jun 13, 2024
1 parent 86a621c commit c81ab04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cern_access/indico_cern_access/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ def withdraw_access_requests(registrations):

def withdraw_event_access_request(req):
"""Withdraw all CERN access requests of an event."""
from indico_cern_access.plugin import CERNAccessPlugin
requested_forms = get_requested_forms(req.event)
requested_registrations = get_requested_registrations(req.event)
if requested_registrations:
Expand All @@ -261,7 +262,8 @@ def withdraw_event_access_request(req):
regform.cern_access_request.request_state = CERNAccessRequestState.withdrawn
remove_access_template(regform)
withdraw_access_requests(requested_registrations)
notify_access_withdrawn(requested_registrations)
if not CERNAccessPlugin.instance._is_past_event(req.event):
notify_access_withdrawn(requested_registrations)


def get_random_reservation_code():
Expand Down

0 comments on commit c81ab04

Please sign in to comment.