The Creating A Repository Using A Template API Doesn't Work, But Web UI Does #7938

Closed
opened 2025-11-02 07:42:15 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @vw98075 on GitHub (Oct 6, 2021).

Gitea Version

1.15

Git Version

2.30.1 (Apple Git-130)

Operating System

MacOS

How are you running Gitea?

Downloading the source code and run it locally with ./gitea webapp

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

Setup:

An admin user A has a private repo template under this account. And another admin user B wants to create a new repo (in this account) with the repo template.

On the web UI, the repo template is visible to user B and user B can create a repo with the repo template successfully.

An API /repos//<repo template/generate request submitted by user B would yield the "404 Not Found" error. The generate repo option data set up is shown as the following:

        this.name = name;
        this.owner = owner;
        this._private = isPrivate;
        this.avatar = true;
        this.gitContent = true;
        this.gitHooks = true;
        this.labels = true;
        this.topics = true;
        this.webhooks = true;

Also, the same request submitted by user A will succeed. User B had successfully submitted such a request once. I don't see anything to prevent user B to submit the same request multiple times. For example, there isn't the same repo name under the user B account.

Screenshots

No response

Originally created by @vw98075 on GitHub (Oct 6, 2021). ### Gitea Version 1.15 ### Git Version 2.30.1 (Apple Git-130) ### Operating System MacOS ### How are you running Gitea? Downloading the source code and run it locally with ./gitea webapp ### Database PostgreSQL ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Description Setup: An admin user A has a private repo template under this account. And another admin user B wants to create a new repo (in this account) with the repo template. On the web UI, the repo template is visible to user B and user B can create a repo with the repo template successfully. An API /repos/<repo template owner>/<repo template/generate request submitted by user B would yield the "404 Not Found" error. The generate repo option data set up is shown as the following: ``` this.name = name; this.owner = owner; this._private = isPrivate; this.avatar = true; this.gitContent = true; this.gitHooks = true; this.labels = true; this.topics = true; this.webhooks = true; ``` Also, the same request submitted by user A will succeed. User B had successfully submitted such a request once. I don't see anything to prevent user B to submit the same request multiple times. For example, there isn't the same repo name under the user B account. ### Screenshots _No response_
Author
Owner

@techknowlogick commented on GitHub (Oct 6, 2021):

Closing as you've reported unable to replicate on try.gitea.io.

@techknowlogick commented on GitHub (Oct 6, 2021): Closing as you've reported unable to replicate on try.gitea.io.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7938