fixed issue adding repository when no teams exist
This commit is contained in:
parent
d5e5797934
commit
07c6c4a4ff
2 changed files with 4 additions and 1 deletions
|
@ -2,6 +2,7 @@ package handler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/drone/drone/pkg/channel"
|
"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 {
|
if len(teamName) > 0 {
|
||||||
team, err := database.GetTeamSlug(teamName)
|
team, err := database.GetTeamSlug(teamName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Printf("error retrieving team %s", teamName)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,6 +136,7 @@ func RepoCreateGithub(w http.ResponseWriter, r *http.Request, u *User) error {
|
||||||
|
|
||||||
// Save to the database
|
// Save to the database
|
||||||
if err := database.SaveRepo(repo); err != nil {
|
if err := database.SaveRepo(repo); err != nil {
|
||||||
|
log.Print("error saving new repository to the database")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<div class="alert">Select your Drone account</div>
|
<div class="alert">Select your Drone account</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<input type="radio" name="team" checked="True">
|
<input type="radio" name="team" checked="True" value="">
|
||||||
<img src="{{ .User.Image }}?s=32">
|
<img src="{{ .User.Image }}?s=32">
|
||||||
<span>Me</span>
|
<span>Me</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in a new issue