mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-24 10:07:21 +02:00
fixed issue adding repository when no teams exist
This commit is contained in:
parent
d5e5797934
commit
07c6c4a4ff
@ -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
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user