diff options
Diffstat (limited to 'app/models/user_team.rb')
-rw-r--r-- | app/models/user_team.rb | 5 |
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" } |