mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: current_user should be called only if controller have that method
This commit is contained in:
parent
ef0d9d631c
commit
19247f9087
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV["
|
|||
config.lograge.custom_payload do |controller|
|
||||
{
|
||||
ip: controller.request.remote_ip,
|
||||
username: controller.current_user&.username,
|
||||
username: controller.try(:current_user)&.username,
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue