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: 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.")
return True
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"Type/Variant Combination is not allowed: ({_type}, {variant})")
return True