Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user_team.rb')
-rw-r--r--app/models/user_team.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/user_team.rb b/app/models/user_team.rb
index dc8cf9eeb22..2f3091c2353 100644
--- a/app/models/user_team.rb
+++ b/app/models/user_team.rb
@@ -21,8 +21,11 @@ class UserTeam < ActiveRecord::Base
has_many :projects, through: :user_team_project_relationships
has_many :members, through: :user_team_user_relationships, source: :user
- validates :name, presence: true, uniqueness: true
validates :owner, presence: true
+ validates :name, presence: true, uniqueness: true,
+ length: { within: 0..255 },
+ format: { with: Gitlab::Regex.name_regex,
+ message: "only letters, digits, spaces & '_' '-' '.' allowed." }
validates :path, uniqueness: true, presence: true, length: { within: 1..255 },
format: { with: Gitlab::Regex.path_regex,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }