Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

feat: allow Hangul(korean character) in creating and renaming vfolder #59

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
4 changes: 2 additions & 2 deletions src/ai/backend/common/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,14 +465,14 @@ def check_and_return(self, value: Any) -> datetime.timedelta:

class Slug(t.Trafaret, metaclass=StringLengthMeta):

_rx_slug = re.compile(r'^[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$')
_rx_slug = re.compile(r'^[\w\-.\s]+$')

def __init__(self, *, min_length: Optional[int] = None, max_length: Optional[int] = None,
allow_dot: bool = False) -> None:
super().__init__()
self._allow_dot = allow_dot
if min_length is not None and min_length < 0:
raise TypeError('min_length must be larger than or equal to zero.')
raise TypeError('min_length must be larger than or equal to: zero.')
lizable marked this conversation as resolved.
Show resolved Hide resolved
if max_length is not None and max_length < 0:
raise TypeError('max_length must be larger than or equal to zero.')
if max_length is not None and min_length is not None and min_length > max_length:
Expand Down