Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Move color pattern to the top of the file
Pacu2da98d1db9302
diff --git a/saleor/graphql/product/types.py b/saleor/graphql/product/types.pyindex a0c13dd5e4..878105af7e 100644--- a/saleor/graphql/product/types.py+++ b/saleor/graphql/product/types.py@@ -19,6 +19,7 @@ from ..utils import get_database_idfrom .filters import ProductFilterSetCOLOR_PATTERN = r'^(#[0-9a-fA-F]{3}|#(?:[0-9a-fA-F]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$' # noqa+color_pattern = re.compile(COLOR_PATTERN)class ProductAttributeValueType(graphene.Enum):@@ -47,7 +48,6 @@ def resolve_attribute_list(attributes):def resolve_attribute_value_type(attribute_value):- color_pattern = re.compile(COLOR_PATTERN)if color_pattern.match(attribute_value):return ProductAttributeValueType.COLORif 'gradient(' in attribute_value: