Commit 1c0157cb authored by Avris's avatar Avris

fix project name validation

parent 5f01a1ae
......@@ -23,6 +23,7 @@ class ProjectForm extends Form
$this
->add('name', Widget\Text::class, [], [
new Assert\NotBlank(),
new Assert\Regexp('^\w[\w-.]*\w$', l('validator.NameFormat')),
new Assert\Unique(
$this->container->get('orm'),
$this->object,
......
......@@ -14,7 +14,7 @@ class ServerForm extends Form
$this
->add('name', Text::class, [], [
new Assert\NotBlank(),
new Assert\Regexp('^\w[\w-.]*\w$')
new Assert\Regexp('^\w[\w-.]*\w$', l('validator.NameFormat'))
])
->add('url', Url::class, [], [])
;
......
......@@ -175,6 +175,7 @@ api:
validator:
NewProjectUser: This user already has access to the project.
UrlTemplate: This field must be a URL containing a placeholder {{server}}
NameFormat: The value can only contain letters, numbers, dashes and dots.
crud:
delete:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment