1
0
Преглед на файлове

#2630 fix wrong user avatar link in webhook

Was using the wrong method and now uses the method which checks if
the avatar link is relative or not.
Unknwon преди 10 години
родител
ревизия
2765b5c7cf
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      models/action.go
  2. 1 1
      routers/repo/webhook.go

+ 1 - 1
models/action.go

@@ -498,7 +498,7 @@ func CommitRepoAction(
 	payloadSender := &api.PayloadUser{
 		UserName:  pusher.Name,
 		ID:        pusher.Id,
-		AvatarUrl: setting.AppUrl + pusher.RelAvatarLink(),
+		AvatarUrl: pusher.AvatarLink(),
 	}
 
 	switch opType {

+ 1 - 1
routers/repo/webhook.go

@@ -364,7 +364,7 @@ func TestWebhook(ctx *middleware.Context) {
 		Sender: &api.PayloadUser{
 			UserName:  ctx.User.Name,
 			ID:        ctx.User.Id,
-			AvatarUrl: setting.AppUrl + ctx.User.RelAvatarLink(),
+			AvatarUrl: ctx.User.AvatarLink(),
 		},
 	}
 	if err := models.PrepareWebhooks(ctx.Repo.Repository, models.HOOK_EVENT_PUSH, p); err != nil {