diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-28 06:12:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-28 06:12:02 +0300 |
commit | 26169f534ccd8a387681dce7b389493bfffb2896 (patch) | |
tree | 53dc6a791b6249da97aea28df4073345c5c27009 /app/models | |
parent | bbe7abcfbd53a824b3ad493e7ddf2fbe485ee42f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index ffce5b6b8aa..2934f295061 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -559,13 +559,16 @@ class Project < ApplicationRecord allow_blank: true validates :name, presence: true, - length: { maximum: 255 }, - format: { with: Gitlab::Regex.project_name_regex, - message: Gitlab::Regex.project_name_regex_message } + length: { maximum: 255 } validates :path, presence: true, project_path: true, length: { maximum: 255 } + + validates :name, + format: { with: Gitlab::Regex.project_name_regex, + message: Gitlab::Regex.project_name_regex_message }, + if: :name_changed? validates :path, format: { with: Gitlab::Regex.oci_repository_path_regex, message: Gitlab::Regex.oci_repository_path_regex_message }, |