fix bug when not passing variant to type which has variants

This commit is contained in:
Neil Hanlon 2023-05-13 17:30:30 -04:00
parent f26149337d
commit 78154eb23e
Signed by untrusted user: neil
GPG key ID: 705BC21EC3C70F34

View file

@ -119,7 +119,7 @@ def valid_type_variant(_type: str, variant: str="") -> bool:
raise Exception(f"{_type} Type expects no variant type.") raise Exception(f"{_type} Type expects no variant type.")
return True return True
if variant not in ALLOWED_TYPE_VARIANTS[_type]: if variant not in ALLOWED_TYPE_VARIANTS[_type]:
if variant.capitalize() in ALLOWED_TYPE_VARIANTS[_type]: if variant and variant.capitalize() in ALLOWED_TYPE_VARIANTS[_type]:
raise Exception(f"Capitalization mismatch. Found: ({_type}, {variant}). Expected: ({_type}, {variant.capitalize()})") raise Exception(f"Capitalization mismatch. Found: ({_type}, {variant}). Expected: ({_type}, {variant.capitalize()})")
raise Exception(f"Type/Variant Combination is not allowed: ({_type}, {variant})") raise Exception(f"Type/Variant Combination is not allowed: ({_type}, {variant})")
return True return True