fix: return 9:00 as default time for reminders if none was set
continuous-integration/drone/push Build is failing Details

Resolves vikunja/api#1211
This commit is contained in:
kolaente 2022-07-19 16:38:48 +02:00
parent f8cc67d37f
commit 79b31673e2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 5 additions and 1 deletions

View File

@ -200,7 +200,7 @@ func (apiUser *APIUserPassword) APIFormat() *User {
// GetUserByID gets informations about a user by its ID
func GetUserByID(s *xorm.Session, id int64) (user *User, err error) {
// Apparently xorm does otherwise look for all users but return only one, which leads to returing one even if the ID is 0
// Apparently xorm does otherwise look for all users but return only one, which leads to returning one even if the ID is 0
if id < 1 {
return &User{}, ErrUserDoesNotExist{}
}
@ -280,6 +280,10 @@ func getUser(s *xorm.Session, user *User, withEmail bool) (userOut *User, err er
userOut.Email = ""
}
if userOut.OverdueTasksRemindersTime == "" {
userOut.OverdueTasksRemindersTime = "9:00"
}
return userOut, err
}