summaryrefslogtreecommitdiffstats
path: root/model/team.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/team.go')
-rw-r--r--model/team.go26
1 files changed, 24 insertions, 2 deletions
diff --git a/model/team.go b/model/team.go
index 95e2757c8..f80fa3b11 100644
--- a/model/team.go
+++ b/model/team.go
@@ -27,7 +27,6 @@ type Team struct {
Type string `json:"type"`
CompanyName string `json:"company_name"`
AllowedDomains string `json:"allowed_domains"`
- AllowValet bool `json:"allow_valet"`
}
type Invites struct {
@@ -74,6 +73,26 @@ func TeamFromJson(data io.Reader) *Team {
}
}
+func TeamMapToJson(u map[string]*Team) string {
+ b, err := json.Marshal(u)
+ if err != nil {
+ return ""
+ } else {
+ return string(b)
+ }
+}
+
+func TeamMapFromJson(data io.Reader) map[string]*Team {
+ decoder := json.NewDecoder(data)
+ var teams map[string]*Team
+ err := decoder.Decode(&teams)
+ if err == nil {
+ return teams
+ } else {
+ return nil
+ }
+}
+
func (o *Team) Etag() string {
return Etag(o.Id, o.UpdateAt)
}
@@ -158,7 +177,7 @@ func IsReservedTeamName(s string) bool {
func IsValidTeamName(s string) bool {
- if !IsValidAlphaNum(s) {
+ if !IsValidAlphaNum(s, false) {
return false
}
@@ -197,3 +216,6 @@ func CleanTeamName(s string) string {
return s
}
+
+func (o *Team) PreExport() {
+}