From ca0b22ced2b5dbf4bcaa973e0bf2a4b50b29be5d Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Thu, 21 Sep 2023 14:00:04 -0600 Subject: [PATCH] - adding isNone since empty string fields are also None --- .../tdpservice/parsers/schema_defs/tanf/t1.py | 18 ++-- .../tdpservice/parsers/schema_defs/tanf/t2.py | 102 +++++++++--------- .../tdpservice/parsers/schema_defs/tanf/t3.py | 36 +++---- tdrs-backend/tdpservice/parsers/validators.py | 6 +- 4 files changed, 81 insertions(+), 81 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py index 4d3820c1c..af39fcb5d 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py @@ -94,7 +94,7 @@ Field(item="5", name='STRATUM', type='string', startIndex=22, endIndex=24, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()), + validators.isNone()), ]), Field(item="16", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=38, endIndex=42, @@ -104,7 +104,7 @@ Field(item="17", name='RECEIVES_SUB_CC', type='number', startIndex=42, endIndex=43, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.isInLimits(0, 3), - validators.numIsBlank()), + validators.isNone()), ]), Field(item="18", name='AMT_SUB_CC', type='number', startIndex=43, endIndex=47, required=True, validators=[ @@ -149,22 +149,22 @@ Field(item="24A", name='TRANSITION_SERVICES_AMOUNT', type='number', startIndex=78, endIndex=82, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.isLargerThanOrEqualTo(0), - validators.numIsBlank()), + validators.isNone()), ]), Field(item="24B", name='TRANSITION_NBR_MONTHS', type='number', startIndex=82, endIndex=85, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.isLargerThanOrEqualTo(0), - validators.numIsBlank()), + validators.isNone()), ]), Field(item="25A", name='OTHER_AMOUNT', type='number', startIndex=85, endIndex=89, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.isLargerThanOrEqualTo(0), - validators.numIsBlank()), + validators.isNone()), ]), Field(item="25B", name='OTHER_NBR_MONTHS', type='number', startIndex=89, endIndex=92, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.isLargerThanOrEqualTo(0), - validators.numIsBlank()), + validators.isNone()), ]), Field(item="26AI", name='SANC_REDUCTION_AMT', type='number', startIndex=92, endIndex=96, required=True, validators=[ @@ -177,7 +177,7 @@ Field(item="26AIII", name='FAMILY_SANC_ADULT', type='number', startIndex=97, endIndex=98, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.oneOf([0, 1, 2]), - validators.numIsBlank()), + validators.isNone()), ]), Field(item="26AIV", name='SANC_TEEN_PARENT', type='number', startIndex=98, endIndex=99, required=True, validators=[ @@ -222,7 +222,7 @@ validators.or_validators(validators.matches('9'), validators.isEmpty()), validators.isAlphaNumeric() ), - validators.isBlank()), + validators.isNone()), ]), Field(item="28", name='FAMILY_EXEMPT_TIME_LIMITS', type='number', startIndex=114, endIndex=116, required=True, validators=[ @@ -232,7 +232,7 @@ Field(item="29", name='FAMILY_NEW_CHILD', type='number', startIndex=116, endIndex=117, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.oneOf([1, 2]), - validators.numIsBlank()), + validators.isNone()), ]), Field(item="-1", name='BLANK', type='string', startIndex=117, endIndex=156, required=False, validators=[]), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index 5d7946abe..aef798a2f 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -112,27 +112,27 @@ Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 2), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 2), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 2), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 2), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 2), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 2), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="35", name='GENDER', type='number', startIndex=44, endIndex=45, required=True, validators=[validators.isLargerThanOrEqualTo(0),]), Field(item="36A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, required=True, @@ -141,54 +141,54 @@ validators=[validators.oneOf([1, 2])]), Field(item="36C", name='DISABLED_TITLE_XIVAPDT', type='string', startIndex=47, endIndex=48, can_be_empty=True, required=True, - validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isBlank())]), + validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isNone())]), Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isLargerThanOrEqualTo(0), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="36E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, required=True, validators=[validators.oneOf([1, 2]),]), Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 5), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="38", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, required=True, validators=[validators.isInStringRange(1, 10),]), Field(item="39", name='PARENT_WITH_MINOR_CHILD', type='number', startIndex=53, endIndex=54, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 3), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 9), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 16), validators.isInStringRange(98, 99), - validators.isBlank())]), + validators.isNone())]), Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, can_be_empty=True, required=True, validators=[validators.or_validators(validators.oneOf([0, 1, 2, 9]), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, can_be_empty=True, required=True, validators=[validators.or_validators(validators.oneOf([0, 1, 2, 9]), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', startIndex=59, endIndex=62, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 999), - validators.isBlank()),]), + validators.isNone()),]), Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', startIndex=62, endIndex=64, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', type='number', startIndex=64, endIndex=65, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 9), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInLimits(0, 3), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="48", name='WORK_ELIGIBLE_INDICATOR', type='string', startIndex=66, endIndex=68, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 9), validators.oneOf(('11', '12')) @@ -198,108 +198,108 @@ validators=[validators.or_validators( validators.oneOf(['01', '02', '05', '07', '09', '15', '16', '17', '18', '19', '99']), - validators.isBlank()),]), + validators.isNone()),]), Field(item="50", name='UNSUB_EMPLOYMENT', type='string', startIndex=70, endIndex=72, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="51", name='SUB_PRIVATE_EMPLOYMENT', type='string', startIndex=72, endIndex=74, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="52", name='SUB_PUBLIC_EMPLOYMENT', type='string', startIndex=74, endIndex=76, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="53A", name='WORK_EXPERIENCE_HOP', type='string', startIndex=76, endIndex=78, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="53B", name='WORK_EXPERIENCE_EA', type='string', startIndex=78, endIndex=80, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="53C", name='WORK_EXPERIENCE_HOL', type='string', startIndex=80, endIndex=82, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="54", name='OJT', type='string', startIndex=82, endIndex=84, can_be_empty=True, required=True, validators=[ validators.or_validators( validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="55A", name='JOB_SEARCH_HOP', type='string', startIndex=84, endIndex=86, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="55B", name='JOB_SEARCH_EA', type='string', startIndex=86, endIndex=88, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="55C", name='JOB_SEARCH_HOL', type='string', startIndex=88, endIndex=90, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="56A", name='COMM_SERVICES_HOP', type='string', startIndex=90, endIndex=92, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="56B", name='COMM_SERVICES_EA', type='string', startIndex=92, endIndex=94, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="56C", name='COMM_SERVICES_HOL', type='string', startIndex=94, endIndex=96, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="57A", name='VOCATIONAL_ED_TRAINING_HOP', type='string', startIndex=96, endIndex=98, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="57B", name='VOCATIONAL_ED_TRAINING_EA', type='string', startIndex=98, endIndex=100, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="57C", name='VOCATIONAL_ED_TRAINING_HOL', type='string', startIndex=100, endIndex=102, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="58A", name='JOB_SKILLS_TRAINING_HOP', type='string', startIndex=102, endIndex=104, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="58B", name='JOB_SKILLS_TRAINING_EA', type='string', startIndex=104, endIndex=106, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="58C", name='JOB_SKILLS_TRAINING_HOL', type='string', startIndex=106, endIndex=108, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="59A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='string', startIndex=108, endIndex=110, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="59B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='string', startIndex=110, endIndex=112, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="59C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', type='string', startIndex=112, endIndex=114, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="60A", name='SCHOOL_ATTENDENCE_HOP', type='string', startIndex=114, endIndex=116, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="60B", name='SCHOOL_ATTENDENCE_EA', type='string', startIndex=116, endIndex=118, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="60C", name='SCHOOL_ATTENDENCE_HOL', type='string', startIndex=118, endIndex=120, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="61A", name='PROVIDE_CC_HOP', type='string', startIndex=120, endIndex=122, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="61B", name='PROVIDE_CC_EA', type='string', startIndex=122, endIndex=124, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="61C", name='PROVIDE_CC_HOL', type='string', startIndex=124, endIndex=126, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="62", name='OTHER_WORK_ACTIVITIES', type='string', startIndex=126, endIndex=128, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="63", name='DEEMED_HOURS_FOR_OVERALL', type='string', startIndex=128, endIndex=130, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="64", name='DEEMED_HOURS_FOR_TWO_PARENT', type='string', startIndex=130, endIndex=132, can_be_empty=True, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 99), - validators.isBlank()),]), + validators.isNone()),]), Field(item="65", name='EARNED_INCOME', type='string', startIndex=132, endIndex=136, required=True, validators=[validators.isInStringRange(0, 9999),]), Field(item="66A", name='UNEARNED_INCOME_TAX_CREDIT', type='string', startIndex=136, endIndex=140, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 9999), - validators.isBlank()),]), + validators.isNone()),]), Field(item="66B", name='UNEARNED_SOCIAL_SECURITY', type='string', startIndex=140, endIndex=144, required=True, validators=[validators.isInStringRange(0, 9999),]), Field(item="66C", name='UNEARNED_SSI', type='string', startIndex=144, endIndex=148, required=True, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py index 2ae3d022a..9dc4a1422 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py @@ -85,22 +85,22 @@ is_encrypted=False), Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="70C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="70D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="70F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="71", name='GENDER', type='number', startIndex=43, endIndex=44, required=True, validators=[ validators.isInLimits(0, 9) @@ -116,12 +116,12 @@ Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=46, endIndex=48, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.isInStringRange(0, 10), - validators.isBlank()) + validators.isNone()) ]), Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=48, endIndex=49, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.oneOf([0, 2, 3]), - validators.numIsBlank()) + validators.isNone()) ]), Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=49, endIndex=51, required=True, validators=[ @@ -133,7 +133,7 @@ Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=51, endIndex=52, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.oneOf([0, 1, 2, 9]), - validators.numIsBlank()) + validators.isNone()) ]), Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=52, endIndex=56, required=True, validators=[ @@ -223,22 +223,22 @@ is_encrypted=False), Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=78, endIndex=79, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=79, endIndex=80, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="70C", name='RACE_ASIAN', type='number', startIndex=80, endIndex=81, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="70D", name='RACE_BLACK', type='number', startIndex=81, endIndex=82, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=82, endIndex=83, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="70F", name='RACE_WHITE', type='number', startIndex=83, endIndex=84, can_be_empty=True, required=True, validators=[validators.or_validators(validators.validateRace(), - validators.numIsBlank()),]), + validators.isNone()),]), Field(item="71", name='GENDER', type='number', startIndex=84, endIndex=85, required=True, validators=[ validators.isInLimits(0, 9) @@ -254,12 +254,12 @@ Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=87, endIndex=89, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.isInStringRange(0, 10), - validators.isBlank()) + validators.isNone()) ]), Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.oneOf([0, 2, 3]), - validators.numIsBlank()) + validators.isNone()) ]), Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=90, endIndex=92, required=True, validators=[ @@ -271,7 +271,7 @@ Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=92, endIndex=93, can_be_empty=True, required=True, validators=[ validators.or_validators(validators.oneOf([0, 1, 2, 9]), - validators.numIsBlank()) + validators.isNone()) ]), Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=93, endIndex=97, required=True, validators=[ diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index 3354c49c0..d5edae128 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -179,11 +179,11 @@ def isBlank(): lambda value: f'{value} is not blank.' ) -def numIsBlank(): - """Validate that a number field was all blanks at parse time.""" +def isNone(): + """Validate that a value is None/blank.""" return make_validator( lambda value: value is None, - lambda value: f'{value} is not a blank integer.' + lambda value: f'{value} is not blank.' ) def isInStringRange(lower, upper):