Fix OptionsDeleter audit log keys (#4704) (#4731)

* Fix OptionsDeleter audit log keys

* Added TO API test to check audit log message

* Undo whitespace addition in changelog message because it breaks tests

* fixes timing of error message on delete

Co-authored-by: Jeremy Mitchell <mitchell852@gmail.com>
(cherry picked from commit 09bfc378284639fde6c8a9474ac831ba93b78de9)
diff --git a/traffic_ops/traffic_ops_golang/api/shared_handlers.go b/traffic_ops/traffic_ops_golang/api/shared_handlers.go
index faceffe..846822e 100644
--- a/traffic_ops/traffic_ops_golang/api/shared_handlers.go
+++ b/traffic_ops/traffic_ops_golang/api/shared_handlers.go
@@ -315,25 +315,23 @@
 			HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)
 			return
 		}
-		if !deleteKeyOptionExists {
-			keyFields := obj.GetKeyFieldsInfo() // expecting a slice of the key fields info which is a struct with the field name and a function to convert a string into a interface{} of the right type. in most that will be [{Field:"id",Func: func(s string)(interface{},error){return strconv.Atoi(s)}}]
-			keys := make(map[string]interface{})
-			for _, kf := range keyFields {
-				paramKey := inf.Params[kf.Field]
-				if paramKey == "" {
-					HandleErr(w, r, inf.Tx.Tx, http.StatusBadRequest, errors.New("missing key: "+kf.Field), nil)
-					return
-				}
-
-				paramValue, err := kf.Func(paramKey)
-				if err != nil {
-					HandleErr(w, r, inf.Tx.Tx, http.StatusBadRequest, errors.New("failed to parse key: "+kf.Field), nil)
-					return
-				}
-				keys[kf.Field] = paramValue
+		keyFields := obj.GetKeyFieldsInfo() // expecting a slice of the key fields info which is a struct with the field name and a function to convert a string into a interface{} of the right type. in most that will be [{Field:"id",Func: func(s string)(interface{},error){return strconv.Atoi(s)}}]
+		keys := make(map[string]interface{})
+		for _, kf := range keyFields {
+			paramKey := inf.Params[kf.Field]
+			if paramKey == "" {
+				HandleErr(w, r, inf.Tx.Tx, http.StatusBadRequest, errors.New("missing key: "+kf.Field), nil)
+				return
 			}
-			obj.SetKeys(keys) // if the type assertion of a key fails it will be should be set to the zero value of the type and the delete should fail (this means the code is not written properly no changes of user input should cause this.)
+
+			paramValue, err := kf.Func(paramKey)
+			if err != nil {
+				HandleErr(w, r, inf.Tx.Tx, http.StatusBadRequest, errors.New("failed to parse key: "+kf.Field), nil)
+				return
+			}
+			keys[kf.Field] = paramValue
 		}
+		obj.SetKeys(keys) // if the type assertion of a key fails it will be should be set to the zero value of the type and the delete should fail (this means the code is not written properly no changes of user input should cause this.)
 
 		if t, ok := obj.(Tenantable); ok {
 			authorized, err := t.IsTenantAuthorized(inf.User)