mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-20 13:15:14 +02:00
fix: attribute duplicated project to the user who duplicated it
duplicate() kept the original author in created_by. The project list filters on created_by, so a non-admin user could not see the copy they just made. Pass the caller through both duplication paths, the same way import already does since #3017.
This commit is contained in:
4 files changed
+39
-5
No files matched your search
@@ -526,6 +526,8 @@ class TestControllerProjectRoutes:
|
||||
with open(os.path.join(project.path, "demo")) as f:
|
||||
content = f.read()
|
||||
assert content == "hello"
|
||||
# the imported project is owned by the user who imported it
|
||||
assert project.created_by == "admin"
|
||||
|
||||
async def test_import_with_project_name(
|
||||
self, app: FastAPI, client: AsyncClient, tmpdir, controller: Controller
|
||||
@@ -556,6 +558,8 @@ class TestControllerProjectRoutes:
|
||||
)
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
assert response.json()["name"] == "hello"
|
||||
# the duplicated project is owned by the user who duplicated it
|
||||
assert response.json()["created_by"] == "admin"
|
||||
|
||||
async def test_lock_unlock(self, app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None:
|
||||
|
||||
|
||||
Reference in new issue
Block a user