From c6fb95912bb481791c1ca370a46a4da9c05d05ad Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 8 Jul 2015 11:50:10 -0400 Subject: Changing the way we mattermost handles URLs. team.domain.com becomes domain.com/team. Renaming team.Name to team.DisplayName and team.Domain to team.Name. So: team.Name -> url safe name. team.DisplayName -> nice name for users --- model/team.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'model/team.go') diff --git a/model/team.go b/model/team.go index 5c66f3b1f..e7005625b 100644 --- a/model/team.go +++ b/model/team.go @@ -18,8 +18,8 @@ type Team struct { CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` + DisplayName string `json:"display_name"` Name string `json:"name"` - Domain string `json:"domain"` Email string `json:"email"` Type string `json:"type"` CompanyName string `json:"company_name"` @@ -97,20 +97,20 @@ func (o *Team) IsValid() *AppError { return NewAppError("Team.IsValid", "Invalid email", "id="+o.Id) } - if len(o.Name) > 64 { + if len(o.DisplayName) > 64 { return NewAppError("Team.IsValid", "Invalid name", "id="+o.Id) } - if len(o.Domain) > 64 { - return NewAppError("Team.IsValid", "Invalid domain", "id="+o.Id) + if len(o.Name) > 64 { + return NewAppError("Team.IsValid", "Invalid URL Identifier", "id="+o.Id) } - if IsReservedDomain(o.Domain) { + if IsReservedTeamName(o.Name) { return NewAppError("Team.IsValid", "This URL is unavailable. Please try another.", "id="+o.Id) } - if !IsValidDomain(o.Domain) { - return NewAppError("Team.IsValid", "Domain must be 4 or more lowercase alphanumeric characters", "id="+o.Id) + if !IsValidTeamName(o.Name) { + return NewAppError("Team.IsValid", "Name must be 4 or more lowercase alphanumeric characters", "id="+o.Id) } if !(o.Type == TEAM_OPEN || o.Type == TEAM_INVITE) { -- cgit v1.2.3-1-g7c22