Initialize timezone to a default state (#8560)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
59606791a7
Коммит
80b3d14b56
@@ -211,7 +211,7 @@ func (u *User) PreSave() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if u.Timezone == nil {
|
if u.Timezone == nil {
|
||||||
u.Timezone = make(map[string]string)
|
u.Timezone = DefaultUserTimezone()
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(u.Password) > 0 {
|
if len(u.Password) > 0 {
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ func TestUserPreSave(t *testing.T) {
|
|||||||
if user.Timezone == nil {
|
if user.Timezone == nil {
|
||||||
t.Fatal("Timezone is nil")
|
t.Fatal("Timezone is nil")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if user.Timezone["useAutomaticTimezone"] != "true" {
|
||||||
|
t.Fatal("Timezone is not set to default")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUserPreUpdate(t *testing.T) {
|
func TestUserPreUpdate(t *testing.T) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user