mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 16:55:08 +00:00
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|
|
config.lograge.custom_payload do |controller|
|
||||||
{
|
{
|
||||||
ip: controller.request.remote_ip,
|
ip: controller.request.remote_ip,
|
||||||
username: controller.current_user&.username,
|
username: controller.try(:current_user)&.username,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user