From 78154eb23e11becf25c953e1096c6265b4aaa210 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Sat, 13 May 2023 17:30:30 -0400 Subject: [PATCH] fix bug when not passing variant to type which has variants --- iso/empanadas/empanadas/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iso/empanadas/empanadas/common.py b/iso/empanadas/empanadas/common.py index c7a33d4..b466843 100644 --- a/iso/empanadas/empanadas/common.py +++ b/iso/empanadas/empanadas/common.py @@ -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