AuditEvent IP Addresses Displaying Incorrectly

Summary

When viewing the instance audit log, the IP address is rendered as a JSON object rather than as an single IP address

Steps to reproduce

  • Log in as an administrator
  • Go to the Admin Area
  • Open the Audit Log

What is the current bug behavior?

IP addresses display as a JSON object.

Screenshot_2020-06-25_08.30.47

What is the expected correct behavior?

IP Addresses should render as a string containing only the IP address in human-readable format.

Possible fixes

@smcgivern has suggested the following fix (ty!)

diff --git a/ee/app/presenters/audit_event_presenter.rb b/ee/app/presenters/audit_event_presenter.rb
index de344da043f..d4e84896469 100644
--- a/ee/app/presenters/audit_event_presenter.rb
+++ b/ee/app/presenters/audit_event_presenter.rb
@@ -18,7 +18,7 @@ class AuditEventPresenter < Gitlab::View::Presenter::Simple
   end
   def ip_address
-    audit_event.ip_address || details[:ip_address]
+    audit_event.ip_address.to_s || details[:ip_address]
   end
   def details