Skip to content

Commit ee69278

Browse files
committed
Remove duplicated validate_key function
1 parent e9af1ed commit ee69278

File tree

1 file changed

+1
-10
lines changed
  • src/layers/domain/core/cpm_system_id

1 file changed

+1
-10
lines changed

src/layers/domain/core/cpm_system_id/v1.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from domain.core.base import BaseModel
1111
from domain.core.error import InvalidKeyPattern
1212
from domain.core.product_key import ProductKeyType
13+
from domain.core.product_team_key import validate_key
1314
from event.json import json_load
1415
from pydantic import validator
1516

@@ -33,16 +34,6 @@
3334
)
3435

3536

36-
def validate_key(key_value: str, key_type: ProductKeyType):
37-
if key_type and key_type.pattern.match(key_value) is None:
38-
raise InvalidKeyPattern(
39-
f"Key '{key_value}' does not match the expected "
40-
f"pattern '{key_type.pattern.pattern}' associated with "
41-
f"key type '{key_type}'"
42-
)
43-
return key_value
44-
45-
4637
@cache
4738
def _load_existing_ids():
4839
if os.path.exists(PRODUCT_IDS_GENERATED_FILE):

0 commit comments

Comments
 (0)