From 1704ac5bc2ca98bbc36bee695ec2f9122a5389cb Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 15 Dec 2023 16:02:50 +0100 Subject: [PATCH] fix most of the tests --- models/forgefed/star_test.go | 2 +- routers/api/v1/activitypub/repository.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/forgefed/star_test.go b/models/forgefed/star_test.go index 3c4273bf75..0cdaaa693e 100644 --- a/models/forgefed/star_test.go +++ b/models/forgefed/star_test.go @@ -31,7 +31,7 @@ func Test_StarMarshalJSON(t *testing.T) { Object: ap.IRI("https://codeberg.org/api/v1/activitypub/repository-id/1"), }, }, - want: []byte(`{"source":"forgejo","type":"Star","actor":"https://repo.prod.meissa.de/api/activitypub/user-id/1","object":"https://codeberg.org/api/activitypub/repository-id/1"}`), + want: []byte(`{"source":"forgejo","type":"Star","actor":"https://repo.prod.meissa.de/api/v1/activitypub/user-id/1","object":"https://codeberg.org/api/v1/activitypub/repository-id/1"}`), }, } diff --git a/routers/api/v1/activitypub/repository.go b/routers/api/v1/activitypub/repository.go index 40392ea316..4569895216 100644 --- a/routers/api/v1/activitypub/repository.go +++ b/routers/api/v1/activitypub/repository.go @@ -110,7 +110,7 @@ func RepositoryInbox(ctx *context.APIContext) { // Check if user already exists users, err := SearchUsersByLoginName(actorAsLoginId) if err != nil { - ctx.ServerError(fmt.Sprintf("Searching for user failed: %v"), err) + ctx.ServerError("Searching for user failed", err) return } log.Info("RepositoryInbox: local found users: %v", len(users)) @@ -120,7 +120,7 @@ func RepositoryInbox(ctx *context.APIContext) { { user, err = createUserFromAP(ctx, actorId) if err != nil { - ctx.ServerError(fmt.Sprintf("Searching for user failed: %v"), err) + ctx.ServerError("Searching for user failed", err) return } log.Info("RepositoryInbox: created user from ap: %v", user)