remove spurious user limits log (#33038)

Only log a warning when the created user exceeds the `MaxUserLimits` if
`MaxUsersLimit > 0`. This was showing up spuriously on licensed servers
for which no limit applied.

Note that this is distinct from blocking user creation past
`MaxHardUsersLimit`.
This commit is contained in:
Jesse Hallam 2025-07-02 13:29:48 -03:00 committed by GitHub
parent ebe03c1d45
commit d2188ce1dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -335,7 +335,7 @@ func (a *App) createUserOrGuest(c request.CTX, user *model.User, guest bool) (*m
// So, we log the error, not return
c.Logger().Error("Error fetching user limits in createUserOrGuest", mlog.Err(limitErr))
} else {
if userLimits.ActiveUserCount > userLimits.MaxUsersLimit {
if userLimits.MaxUsersLimit > 0 && userLimits.ActiveUserCount > userLimits.MaxUsersLimit {
// Use different warning messages based on whether server is licensed
if a.License() != nil {
c.Logger().Warn("ERROR_LICENSED_USERS_LIMIT_EXCEEDED: Created user exceeds the maximum licensed users.", mlog.Int("user_limit", userLimits.MaxUsersLimit))