fixed issue adding repository when no teams exist

This commit is contained in:
Brad Rydzewski 2014-02-07 03:22:57 -07:00
parent d5e5797934
commit 07c6c4a4ff
2 changed files with 4 additions and 1 deletions

View file

@ -2,6 +2,7 @@ package handler
import (
"fmt"
"log"
"net/http"
"github.com/drone/drone/pkg/channel"
@ -99,6 +100,7 @@ func RepoCreateGithub(w http.ResponseWriter, r *http.Request, u *User) error {
if len(teamName) > 0 {
team, err := database.GetTeamSlug(teamName)
if err != nil {
log.Printf("error retrieving team %s", teamName)
return err
}
@ -134,6 +136,7 @@ func RepoCreateGithub(w http.ResponseWriter, r *http.Request, u *User) error {
// Save to the database
if err := database.SaveRepo(repo); err != nil {
log.Print("error saving new repository to the database")
return err
}

View file

@ -45,7 +45,7 @@
<div class="alert">Select your Drone account</div>
<ul>
<li>
<input type="radio" name="team" checked="True">
<input type="radio" name="team" checked="True" value="">
<img src="{{ .User.Image }}?s=32">
<span>Me</span>
</li>