From 01635cdc4cacde2aecea6ded05275a94c1ea2697 Mon Sep 17 00:00:00 2001 From: Victoria Earl Date: Mon, 25 Sep 2023 10:29:26 -0400 Subject: [PATCH] Only apply child badge validations to new attendees These validations are built solely for the prereg page , so we now ignore them for any attendee that isn't new or pending. --- uber/model_checks.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/uber/model_checks.py b/uber/model_checks.py index 82823e814..31430a1a4 100644 --- a/uber/model_checks.py +++ b/uber/model_checks.py @@ -975,6 +975,9 @@ def child_group_leaders(attendee): @prereg_validation.Attendee def no_more_child_badges(attendee): + if not attendee.is_new and not attendee.badge_status == c.PENDING_STATUS: + return + if c.CHILD_BADGE in c.PREREG_BADGE_TYPES and attendee.birthdate and \ get_age_from_birthday(attendee.birthdate, c.NOW_OR_AT_CON) < 18 and not c.CHILD_BADGE_AVAILABLE: return ('badge_type', "Unfortunately, we are sold out of badges for attendees under 18.") @@ -982,6 +985,9 @@ def no_more_child_badges(attendee): @prereg_validation.Attendee def child_badge_over_13(attendee): + if not attendee.is_new and not attendee.badge_status == c.PENDING_STATUS: + return + if c.CHILD_BADGE in c.PREREG_BADGE_TYPES and attendee.birthdate and attendee.badge_type == c.CHILD_BADGE \ and get_age_from_birthday(attendee.birthdate, c.NOW_OR_AT_CON) >= 13: return ('badge_type', "If you will be 13 or older at the start of {}, " \ @@ -990,6 +996,9 @@ def child_badge_over_13(attendee): @prereg_validation.Attendee def attendee_badge_under_13(attendee): + if not attendee.is_new and not attendee.badge_status == c.PENDING_STATUS: + return + if c.CHILD_BADGE in c.PREREG_BADGE_TYPES and attendee.birthdate and attendee.badge_type == c.ATTENDEE_BADGE \ and get_age_from_birthday(attendee.birthdate, c.NOW_OR_AT_CON) < 13: return ('badge_type', "If you will be 12 or younger at the start of {}, " \