Added name symbol validation.

This commit is contained in:
2026-06-05 12:06:28 +02:00
parent bb2388c914
commit 9a1c18f815

View File

@@ -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