From 4e9c822ce8d472a346dc123335c42a8bd9badd36 Mon Sep 17 00:00:00 2001 From: Damian Gryski Date: Mon, 10 Feb 2014 12:49:12 +0100 Subject: [PATCH 1/4] Two small issues found by 'go vet' --- cmd/drone/drone.go | 2 +- pkg/build/docker/image.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/drone/drone.go b/cmd/drone/drone.go index e3f97ee3..9fdc6b3c 100644 --- a/cmd/drone/drone.go +++ b/cmd/drone/drone.go @@ -164,7 +164,7 @@ func run(path string) { if len(*identity) != 0 { key, err = ioutil.ReadFile(*identity) if err != nil { - fmt.Printf("[Error] Could not find or read identity file %s\n", identity) + fmt.Printf("[Error] Could not find or read identity file %s\n", *identity) os.Exit(1) return } diff --git a/pkg/build/docker/image.go b/pkg/build/docker/image.go index 85954b05..ca5eb052 100644 --- a/pkg/build/docker/image.go +++ b/pkg/build/docker/image.go @@ -59,7 +59,7 @@ func (c *ImageService) List() ([]*Images, error) { // Create an image, either by pull it from the registry or by importing it. func (c *ImageService) Create(image string) error { - return c.do("POST", fmt.Sprintf("/images/create?fromImage=%s"), nil, nil) + return c.do("POST", fmt.Sprintf("/images/create?fromImage=%s", image), nil, nil) } func (c *ImageService) Pull(image string) error { From 7c4299778f070f6f38d0a67c8e14244eaee3e4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sk=C3=B6ld?= Date: Mon, 10 Feb 2014 12:53:55 +0100 Subject: [PATCH 2/4] s/Region/Access/ --- pkg/plugin/publish/s3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/plugin/publish/s3.go b/pkg/plugin/publish/s3.go index cfa75e7d..029b0b5f 100644 --- a/pkg/plugin/publish/s3.go +++ b/pkg/plugin/publish/s3.go @@ -65,8 +65,8 @@ func (s *S3) Write(f *buildfile.Buildfile) { // make sure a default access is set // let's be conservative and assume private - if len(s.Region) == 0 { - s.Region = "private" + if len(s.Access) == 0 { + s.Access = "private" } // if the target starts with a "/" we need From 8773f077e81c2953c9fe6dfe73296f0136fe467d Mon Sep 17 00:00:00 2001 From: Nurahmadie Date: Mon, 10 Feb 2014 15:21:22 +0000 Subject: [PATCH 3/4] Typo on report title. --- pkg/template/emails/success.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/template/emails/success.html b/pkg/template/emails/success.html index a5d9a4b9..31facdfe 100644 --- a/pkg/template/emails/success.html +++ b/pkg/template/emails/success.html @@ -1,4 +1,4 @@ -{{ define "title" }}FAILURE{{end}} +{{ define "title" }}SUCCESS{{end}} {{ define "content" }} @@ -25,4 +25,4 @@ {{ .Commit.Message }} -{{ end }} \ No newline at end of file +{{ end }} From 1283b2b6f28585904a772f3727167a692f1fdde6 Mon Sep 17 00:00:00 2001 From: Scott Ferguson Date: Mon, 10 Feb 2014 15:21:04 -0600 Subject: [PATCH 4/4] Fix team invites --- pkg/handler/members.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/handler/members.go b/pkg/handler/members.go index ff0dea55..27e4b0af 100644 --- a/pkg/handler/members.go +++ b/pkg/handler/members.go @@ -173,7 +173,7 @@ func TeamMemberInvite(w http.ResponseWriter, r *http.Request, u *User) error { } // generate a token that is valid for 3 days to join the team - token := authcookie.New(team.Name, time.Now().Add(72*time.Hour), secret) + token := authcookie.New(strconv.Itoa(int(team.ID)), time.Now().Add(72*time.Hour), secret) // hostname from settings hostname := database.SettingsMust().URL().String() @@ -202,14 +202,14 @@ func TeamMemberInvite(w http.ResponseWriter, r *http.Request, u *User) error { func TeamMemberAccept(w http.ResponseWriter, r *http.Request, u *User) error { // get the team name from the token token := r.FormValue("token") - teamName := authcookie.Login(token, secret) - if len(teamName) == 0 { + teamToken := authcookie.Login(token, secret) + teamId, err := strconv.Atoi(teamToken) + if err != nil || teamId == 0 { return ErrInvalidTeamName } // get the team from the database - // TODO it might make more sense to use the ID in case the Slug changes - team, err := database.GetTeamSlug(teamName) + team, err := database.GetTeam(int64(teamId)) if err != nil { return RenderError(w, err, http.StatusNotFound) } @@ -222,6 +222,6 @@ func TeamMemberAccept(w http.ResponseWriter, r *http.Request, u *User) error { } // send the user to the dashboard - http.Redirect(w, r, "/dashboard/team/"+team.Name, http.StatusSeeOther) + http.Redirect(w, r, "/dashboard/team/"+team.Slug, http.StatusSeeOther) return nil }