diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-07-08 11:50:10 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-07-20 17:45:23 -0400 |
commit | c6fb95912bb481791c1ca370a46a4da9c05d05ad (patch) | |
tree | bb33ff7b494b45c9d95c15f290d97914e911ce91 /model/team.go | |
parent | a1876cf6cc827743d8687a9113b727ef7190f452 (diff) | |
download | chat-c6fb95912bb481791c1ca370a46a4da9c05d05ad.tar.gz chat-c6fb95912bb481791c1ca370a46a4da9c05d05ad.tar.bz2 chat-c6fb95912bb481791c1ca370a46a4da9c05d05ad.zip |
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
Diffstat (limited to 'model/team.go')
-rw-r--r-- | model/team.go | 14 |
1 files changed, 7 insertions, 7 deletions
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) { |