From 22b8b90fab9d825e47b0eb87e81bfcf0b91e0a44 Mon Sep 17 00:00:00 2001 From: Adriel Velazquez Date: Fri, 20 May 2016 14:30:56 -0400 Subject: [PATCH] Allow numbers in to_constant Enums aren't effected if a int is passed along with the string. --- graphene/utils/str_converters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphene/utils/str_converters.py b/graphene/utils/str_converters.py index 3b06ee05..ae8ceffe 100644 --- a/graphene/utils/str_converters.py +++ b/graphene/utils/str_converters.py @@ -18,4 +18,4 @@ def to_snake_case(name): def to_const(string): - return re.sub('[\W|^(?=\d)]+', '_', string).upper() + return re.sub('[\W|^]+', '_', string).upper()