mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
fix user timezone initialization (#8547)
On PreSave, need to ensure TimeZone isn't left as NULL.
This commit is contained in:
committed by
Joram Wilander
parent
014a3b6a60
commit
0affad9c24
@@ -211,7 +211,7 @@ func (u *User) PreSave() {
|
||||
}
|
||||
|
||||
if u.Timezone == nil {
|
||||
u.Props = make(map[string]string)
|
||||
u.Timezone = make(map[string]string)
|
||||
}
|
||||
|
||||
if len(u.Password) > 0 {
|
||||
|
||||
@@ -36,6 +36,9 @@ func TestUserPreSave(t *testing.T) {
|
||||
user := User{Password: "test"}
|
||||
user.PreSave()
|
||||
user.Etag(true, true)
|
||||
if user.Timezone == nil {
|
||||
t.Fatal("Timezone is nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUserPreUpdate(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user