summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-08-20 23:05:30 +0800
committerAntoine GIRARD <sapk@users.noreply.github.com>2019-08-20 17:05:30 +0200
commit9b9d16219493be55c7af6a40b9da8869c247b28e (patch)
tree2c05dbf3b294eb1f4441ed370f9edf11ded586a9
parent8c10d91086728fa7575641cf63cd8ed421e14e01 (diff)
downloadgitea-9b9d16219493be55c7af6a40b9da8869c247b28e.tar.gz
gitea-9b9d16219493be55c7af6a40b9da8869c247b28e.zip
fix wrong sender when send slack webhook (#7918)
-rw-r--r--models/release.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/models/release.go b/models/release.go
index 7ef0134c9d..e35a55741a 100644
--- a/models/release.go
+++ b/models/release.go
@@ -409,7 +409,7 @@ func UpdateRelease(doer *User, gitRepo *git.Repository, rel *Release, attachment
Action: api.HookReleaseUpdated,
Release: rel.APIFormat(),
Repository: rel.Repo.APIFormat(mode),
- Sender: rel.Publisher.APIFormat(),
+ Sender: doer.APIFormat(),
}); err1 != nil {
log.Error("PrepareWebhooks: %v", err)
} else {
@@ -420,7 +420,7 @@ func UpdateRelease(doer *User, gitRepo *git.Repository, rel *Release, attachment
}
// DeleteReleaseByID deletes a release and corresponding Git tag by given ID.
-func DeleteReleaseByID(id int64, u *User, delTag bool) error {
+func DeleteReleaseByID(id int64, doer *User, delTag bool) error {
rel, err := GetReleaseByID(id)
if err != nil {
return fmt.Errorf("GetReleaseByID: %v", err)
@@ -459,12 +459,12 @@ func DeleteReleaseByID(id int64, u *User, delTag bool) error {
return fmt.Errorf("LoadAttributes: %v", err)
}
- mode, _ := AccessLevel(u, rel.Repo)
+ mode, _ := AccessLevel(doer, rel.Repo)
if err := PrepareWebhooks(rel.Repo, HookEventRelease, &api.ReleasePayload{
Action: api.HookReleaseDeleted,
Release: rel.APIFormat(),
Repository: rel.Repo.APIFormat(mode),
- Sender: rel.Publisher.APIFormat(),
+ Sender: doer.APIFormat(),
}); err != nil {
log.Error("PrepareWebhooks: %v", err)
} else {