Spaces:
Running
Running
Commit
·
1b746fa
1
Parent(s):
73ee418
fix validation when string is empty for config
Browse files
src/hf_eda_mcp/validation.py
CHANGED
|
@@ -117,14 +117,8 @@ def validate_config_name(config_name: Optional[str]) -> Optional[str]:
|
|
| 117 |
|
| 118 |
config_name = config_name.strip()
|
| 119 |
|
| 120 |
-
if
|
| 121 |
-
|
| 122 |
-
"config_name cannot be empty or contain only whitespace",
|
| 123 |
-
suggestions=[
|
| 124 |
-
"Provide a valid configuration name or omit the parameter",
|
| 125 |
-
"Use None or don't specify config_name for default configuration",
|
| 126 |
-
],
|
| 127 |
-
)
|
| 128 |
|
| 129 |
# Validate format: alphanumeric, hyphens, underscores, dots
|
| 130 |
pattern = r"^[a-zA-Z0-9][\w\-\.]*$"
|
|
|
|
| 117 |
|
| 118 |
config_name = config_name.strip()
|
| 119 |
|
| 120 |
+
if len(config_name) == 0:
|
| 121 |
+
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
# Validate format: alphanumeric, hyphens, underscores, dots
|
| 124 |
pattern = r"^[a-zA-Z0-9][\w\-\.]*$"
|