summaryrefslogtreecommitdiffstats
path: root/model/team.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-27 22:18:52 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-27 22:18:52 -0700
commitbb25056d9afca501f147450466aaeecca9fef66f (patch)
tree64f7b9eeb590e2cb0fe13b7a2eb55ddb798b30be /model/team.go
parent940f5c29c7c35a66f0b37f62831809e3633a5ea9 (diff)
downloadchat-bb25056d9afca501f147450466aaeecca9fef66f.tar.gz
chat-bb25056d9afca501f147450466aaeecca9fef66f.tar.bz2
chat-bb25056d9afca501f147450466aaeecca9fef66f.zip
PLT-340
Diffstat (limited to 'model/team.go')
-rw-r--r--model/team.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/model/team.go b/model/team.go
index 7f301b71c..4d14ec2ee 100644
--- a/model/team.go
+++ b/model/team.go
@@ -122,7 +122,7 @@ func (o *Team) IsValid(restrictTeamNames bool) *AppError {
return NewAppError("Team.IsValid", "Invalid email", "id="+o.Id)
}
- if len(o.DisplayName) > 64 {
+ if len(o.DisplayName) == 0 || len(o.DisplayName) > 64 {
return NewAppError("Team.IsValid", "Invalid name", "id="+o.Id)
}
@@ -150,10 +150,6 @@ func (o *Team) IsValid(restrictTeamNames bool) *AppError {
return NewAppError("Team.IsValid", "Invalid allowed domains", "id="+o.Id)
}
- if len(o.InviteId) > 0 && len(o.InviteId) != 26 {
- return NewAppError("Team.IsValid", "Invalid inviate Id", "")
- }
-
return nil
}
@@ -164,6 +160,10 @@ func (o *Team) PreSave() {
o.CreateAt = GetMillis()
o.UpdateAt = o.CreateAt
+
+ if len(o.InviteId) == 0 {
+ o.InviteId = NewId()
+ }
}
func (o *Team) PreUpdate() {