You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ra...@apache.org on 2018/10/04 14:39:40 UTC
[trafficcontrol] 08/10: Change TO Go feds func to take name not user
This is an automated email from the ASF dual-hosted git repository.
rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit 24d374ac329c43a42265e3b1960bfcd00bb8d8b6
Author: Robert Butts <ro...@apache.org>
AuthorDate: Mon Oct 1 21:08:51 2018 -0600
Change TO Go feds func to take name not user
---
traffic_ops/traffic_ops_golang/federations/federations.go | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/traffic_ops/traffic_ops_golang/federations/federations.go b/traffic_ops/traffic_ops_golang/federations/federations.go
index 7c984f6..309607d 100644
--- a/traffic_ops/traffic_ops_golang/federations/federations.go
+++ b/traffic_ops/traffic_ops_golang/federations/federations.go
@@ -28,7 +28,6 @@ import (
"github.com/apache/trafficcontrol/lib/go-tc"
"github.com/apache/trafficcontrol/lib/go-util"
"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
- "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/auth"
"github.com/lib/pq"
)
@@ -41,7 +40,7 @@ func Get(w http.ResponseWriter, r *http.Request) {
}
defer inf.Close()
- feds, err := getUserFederations(inf.Tx.Tx, inf.User)
+ feds, err := getUserFederations(inf.Tx.Tx, inf.User.UserName)
if err != nil {
api.HandleErr(w, r, inf.Tx.Tx, http.StatusInternalServerError, nil, errors.New("federations.Get getting federations: "+err.Error()))
return
@@ -134,7 +133,7 @@ WHERE
return feds, nil
}
-func getUserFederations(tx *sql.Tx, user *auth.CurrentUser) ([]FedInfo, error) {
+func getUserFederations(tx *sql.Tx, userName string) ([]FedInfo, error) {
qry := `
SELECT
fds.federation,
@@ -152,7 +151,7 @@ WHERE
ORDER BY
ds.xml_id
`
- rows, err := tx.Query(qry, user.UserName)
+ rows, err := tx.Query(qry, userName)
if err != nil {
return nil, errors.New("user federations querying: " + err.Error())
}