mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 05:47:57 +00:00
Insert and Update Users instead of generic Save function. Check ID != 0
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Request struct {
|
||||
Host string `json:"-"`
|
||||
User *User `json:"-"`
|
||||
@@ -7,3 +11,16 @@ type Request struct {
|
||||
Commit *Commit `json:"commit"`
|
||||
Prior *Commit `json:"prior_commit"`
|
||||
}
|
||||
|
||||
// URL returns the link to the commit in
|
||||
// string format.
|
||||
func (r *Request) URL() string {
|
||||
return fmt.Sprintf("%s/%s/%s/%s",
|
||||
r.Host,
|
||||
r.Repo.Host,
|
||||
r.Repo.Owner,
|
||||
r.Repo.Name,
|
||||
r.Commit.Branch,
|
||||
r.Commit.Sha,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user