fix user timezone initialization (#8547)
On PreSave, need to ensure TimeZone isn't left as NULL.
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
014a3b6a60
Коммит
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) {
|
||||
|
||||
Ссылка в новой задаче
Block a user