users: fix lockout of invalid usernames (525acd17a)

This commit is contained in:
evazion
2022-03-07 04:45:19 -06:00
parent 74d6b4e81e
commit 125cc1d048

View File

@@ -200,7 +200,7 @@ class ApplicationController < ActionController::Base
end
def redirect_if_name_invalid?
if request.format.html? && CurrentUser.user.name_invalid?
if request.format.html? && !CurrentUser.user.is_anonymous? && CurrentUser.user.name_invalid?
flash[:notice] = "You must change your username to continue using #{Danbooru.config.app_name}"
redirect_to new_user_name_change_request_path
end