fix: return 9:00 as default time for reminders if none was set

Resolves https://kolaente.dev/vikunja/api/issues/1211
This commit is contained in:
kolaente 2022-07-19 16:38:48 +02:00
parent f8cc67d37f
commit 79b31673e2
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

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
}