def clear_old_registrations(): for pu in PendingUser.ListAll(): # deliberately a larger delta than we restrict against to avoid # accidentally removing vaild entries if pu.age > timedelta(days = 3): pu.delete() expired = User(pu.username) expired.delete() team_leader = User(pu.teacher_username) inform_team_lead_registration_expired(team_leader, expired)
def clear_old_registrations(): for pu in PendingUser.ListAll(): # deliberately a larger delta than we restrict against to avoid # accidentally removing vaild entries if pu.age > timedelta(days=3): log_action('expiring registration', pu) pu.delete() expired = User(pu.username) expired.delete() team_leader = User(pu.teacher_username) inform_team_lead_registration_expired(team_leader, expired)
def clear_old_registrations(): # deliberately a larger delta than we restrict against to avoid # accidentally removing vaild entries activation_days = config.getint('nemesis', 'activation_days') activation_days += 0.5 max_age = timedelta(days = activation_days) for pu in PendingUser.ListAll(): if pu.age > max_age: log_action('expiring registration', pu) pu.delete() expired = User(pu.username) expired.delete() inform_competitor_registration_expired(pu.email, expired) team_leader = User(pu.teacher_username) inform_team_lead_registration_expired(team_leader, expired)
def clear_old_registrations(): # deliberately a larger delta than we restrict against to avoid # accidentally removing vaild entries activation_days = config.getint('nemesis', 'activation_days') activation_days += 0.5 max_age = timedelta(days=activation_days) for pu in PendingUser.ListAll(): if pu.age > max_age: log_action('expiring registration', pu) pu.delete() expired = User(pu.username) expired.delete() inform_competitor_registration_expired(pu.email, expired) team_leader = User(pu.teacher_username) inform_team_lead_registration_expired(team_leader, expired)