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