diff --git a/pkg/user/user.go b/pkg/user/user.go index 53a9b8121..d1bd45b50 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -314,7 +314,15 @@ func getUser(s *xorm.Session, user *User, withEmail bool) (userOut *User, err er userOut.OverdueTasksRemindersTime = "9:00" } - return userOut, err + if userOut.Status == StatusDisabled { + return userOut, &ErrAccountDisabled{UserID: userOut.ID} + } + + if userOut.Status == StatusAccountLocked { + return userOut, &ErrAccountLocked{UserID: userOut.ID} + } + + return userOut, nil } func getUserByUsernameOrEmail(s *xorm.Session, usernameOrEmail string) (u *User, err error) {