Skip to content

Commit

Permalink
fix: Issue with nil org returned from Bitbucket Datacenter forge
Browse files Browse the repository at this point in the history
Signed-off-by: Thor Anker Kvisgård Lange <[email protected]>
  • Loading branch information
langecode committed Feb 20, 2024
1 parent f5c2c35 commit 2c6d1a8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions server/forge/bitbucketdatacenter/bitbucketdatacenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,17 @@ func (c *client) OrgMembership(_ context.Context, _ *model.User, _ string) (*mod
}

// Org fetches the organization from the forge by name. If the name is a user an org with type user is returned.
func (c *client) Org(_ context.Context, _ *model.User, _ string) (*model.Org, error) {
// TODO: Not implemented currently
return nil, nil
func (c *client) Org(_ context.Context, _ *model.User, owner string) (*model.Org, error) {
if strings.HasPrefix(owner, "~") {
return &model.Org{
Name: owner,
IsUser: true,
}, nil
}
return &model.Org{
Name: owner,
IsUser: false,
}, nil
}

type httpLogger struct {
Expand Down

0 comments on commit 2c6d1a8

Please sign in to comment.