Added name symbol validation.
This commit is contained in:
7
webui.py
7
webui.py
@@ -1,6 +1,6 @@
|
||||
from nicegui import ui
|
||||
from pandas.core.internals.blocks import external_values
|
||||
from bot_instance import bot
|
||||
import re
|
||||
from dom5game import Dom5game
|
||||
import servermanager
|
||||
import os
|
||||
@@ -44,7 +44,10 @@ def creator_page():
|
||||
validation={
|
||||
"Game with that name already exists": lambda value: not (
|
||||
os.path.isdir("games/" + value)
|
||||
)
|
||||
),
|
||||
"Name contains an invalid symbol": lambda value: bool(
|
||||
re.match("^[A-Za-z0-9_-]*$", value)
|
||||
),
|
||||
},
|
||||
)
|
||||
# Port
|
||||
|
||||
Reference in New Issue
Block a user