Skip to content

GET /teams/{id} returns null for organisations #24734

Closed
@Lerentis

Description

@Lerentis

Description

Hello there,

just noticed while working with the Go SDK that the API endpoint for GET /teams/{id} always returns null for organisations, even tho the team with the requested ID is part of an org.

Example json response:

{
  "id": 13,
  "name": "test_team",
  "description": "test team of test org",
  "organization": null,
  "includes_all_repositories": true,
  "permission": "admin",
  "units": [
    "repo.releases",
    "repo.projects",
    "repo.packages",
    "repo.pulls",
    "repo.wiki",
    "repo.ext_wiki",
    "repo.code",
    "repo.issues",
    "repo.ext_issues"
  ],
  "units_map": {
    "repo.code": "admin",
    "repo.ext_issues": "admin",
    "repo.ext_wiki": "admin",
    "repo.issues": "admin",
    "repo.packages": "admin",
    "repo.projects": "admin",
    "repo.pulls": "admin",
    "repo.releases": "admin",
    "repo.wiki": "admin"
  },
  "can_create_org_repo": true
}

i can not reproduce this on https://try.gitea.io/ as i do not have the permissions there to create a organisation it seems.

Gitea Version

1.19.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker-compose.yaml:

version: "3"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:1.19.3
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - DISABLE_GIT_HOOKS=false
    restart: always
    networks:
      - gitea
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "222:22"

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions