diff options
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/models/user.go b/models/user.go index b831a2ebfe..723892b0b6 100644 --- a/models/user.go +++ b/models/user.go @@ -367,7 +367,7 @@ func (u *User) SizedRelAvatarLink(size int) string { case setting.DisableGravatar, setting.OfflineMode: if !com.IsFile(u.CustomAvatarPath()) { if err := u.GenerateRandomAvatar(); err != nil { - log.Error(3, "GenerateRandomAvatar: %v", err) + log.Error("GenerateRandomAvatar: %v", err) } } @@ -523,7 +523,7 @@ func (u *User) IsOrganization() bool { func (u *User) IsUserOrgOwner(orgID int64) bool { isOwner, err := IsOrganizationOwner(orgID, u.ID) if err != nil { - log.Error(4, "IsOrganizationOwner: %v", err) + log.Error("IsOrganizationOwner: %v", err) return false } return isOwner @@ -533,7 +533,7 @@ func (u *User) IsUserOrgOwner(orgID int64) bool { func (u *User) IsUserPartOfOrg(userID int64) bool { isMember, err := IsOrganizationMember(u.ID, userID) if err != nil { - log.Error(4, "IsOrganizationMember: %v", err) + log.Error("IsOrganizationMember: %v", err) return false } return isMember @@ -543,7 +543,7 @@ func (u *User) IsUserPartOfOrg(userID int64) bool { func (u *User) IsPublicMember(orgID int64) bool { isMember, err := IsPublicMembership(orgID, u.ID) if err != nil { - log.Error(4, "IsPublicMembership: %v", err) + log.Error("IsPublicMembership: %v", err) return false } return isMember @@ -864,7 +864,7 @@ func getVerifyUser(code string) (user *User) { if user, err = GetUserByName(string(b)); user != nil { return user } - log.Error(4, "user.getVerifyUser: %v", err) + log.Error("user.getVerifyUser: %v", err) } return nil @@ -1490,11 +1490,11 @@ func deleteKeysMarkedForDeletion(keys []string) (bool, error) { for _, KeyToDelete := range keys { key, err := searchPublicKeyByContentWithEngine(sess, KeyToDelete) if err != nil { - log.Error(4, "SearchPublicKeyByContent: %v", err) + log.Error("SearchPublicKeyByContent: %v", err) continue } if err = deletePublicKeys(sess, key.ID); err != nil { - log.Error(4, "deletePublicKeys: %v", err) + log.Error("deletePublicKeys: %v", err) continue } sshKeysNeedUpdate = true @@ -1515,7 +1515,7 @@ func addLdapSSHPublicKeys(usr *User, s *LoginSource, SSHPublicKeys []string) boo if err == nil { sshKeyName := fmt.Sprintf("%s-%s", s.Name, sshKey[0:40]) if _, err := AddPublicKey(usr.ID, sshKeyName, sshKey, s.ID); err != nil { - log.Error(4, "addLdapSSHPublicKeys[%s]: Error adding LDAP Public SSH Key for user %s: %v", s.Name, usr.Name, err) + log.Error("addLdapSSHPublicKeys[%s]: Error adding LDAP Public SSH Key for user %s: %v", s.Name, usr.Name, err) } else { log.Trace("addLdapSSHPublicKeys[%s]: Added LDAP Public SSH Key for user %s", s.Name, usr.Name) sshKeysNeedUpdate = true @@ -1537,7 +1537,7 @@ func synchronizeLdapSSHPublicKeys(usr *User, s *LoginSource, SSHPublicKeys []str var giteaKeys []string keys, err := ListPublicLdapSSHKeys(usr.ID, s.ID) if err != nil { - log.Error(4, "synchronizeLdapSSHPublicKeys[%s]: Error listing LDAP Public SSH Keys for user %s: %v", s.Name, usr.Name, err) + log.Error("synchronizeLdapSSHPublicKeys[%s]: Error listing LDAP Public SSH Keys for user %s: %v", s.Name, usr.Name, err) } for _, v := range keys { @@ -1586,7 +1586,7 @@ func synchronizeLdapSSHPublicKeys(usr *User, s *LoginSource, SSHPublicKeys []str // Delete LDAP keys from DB that doesn't exist in LDAP needUpd, err := deleteKeysMarkedForDeletion(giteaKeysToDelete) if err != nil { - log.Error(4, "synchronizeLdapSSHPublicKeys[%s]: Error deleting LDAP Public SSH Keys marked for deletion for user %s: %v", s.Name, usr.Name, err) + log.Error("synchronizeLdapSSHPublicKeys[%s]: Error deleting LDAP Public SSH Keys marked for deletion for user %s: %v", s.Name, usr.Name, err) } if needUpd { sshKeysNeedUpdate = true @@ -1606,7 +1606,7 @@ func SyncExternalUsers() { ls, err := LoginSources() if err != nil { - log.Error(4, "SyncExternalUsers: %v", err) + log.Error("SyncExternalUsers: %v", err) return } @@ -1669,7 +1669,7 @@ func SyncExternalUsers() { err = CreateUser(usr) if err != nil { - log.Error(4, "SyncExternalUsers[%s]: Error creating user %s: %v", s.Name, su.Username, err) + log.Error("SyncExternalUsers[%s]: Error creating user %s: %v", s.Name, su.Username, err) } else if isAttributeSSHPublicKeySet { log.Trace("SyncExternalUsers[%s]: Adding LDAP Public SSH Keys for user %s", s.Name, usr.Name) if addLdapSSHPublicKeys(usr, s, su.SSHPublicKey) { @@ -1702,7 +1702,7 @@ func SyncExternalUsers() { err = UpdateUserCols(usr, "full_name", "email", "is_admin", "is_active") if err != nil { - log.Error(4, "SyncExternalUsers[%s]: Error updating user %s: %v", s.Name, usr.Name, err) + log.Error("SyncExternalUsers[%s]: Error updating user %s: %v", s.Name, usr.Name, err) } } } @@ -1729,7 +1729,7 @@ func SyncExternalUsers() { usr.IsActive = false err = UpdateUserCols(&usr, "is_active") if err != nil { - log.Error(4, "SyncExternalUsers[%s]: Error deactivating user %s: %v", s.Name, usr.Name, err) + log.Error("SyncExternalUsers[%s]: Error deactivating user %s: %v", s.Name, usr.Name, err) } } } |