FIX: current_user should be called only if controller have that method
This commit is contained in:
parent
ef0d9d631c
commit
19247f9087
|
@ -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…
Reference in New Issue