mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-21 13:45:13 +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
@@ -886,7 +886,11 @@ async def duplicate_project(
|
||||
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN)
|
||||
|
||||
reset_mac_addresses = project_data.reset_mac_addresses
|
||||
new_project = await project.duplicate(name=project_data.name, reset_mac_addresses=reset_mac_addresses)
|
||||
new_project = await project.duplicate(
|
||||
name=project_data.name,
|
||||
reset_mac_addresses=reset_mac_addresses,
|
||||
user=current_user.username,
|
||||
)
|
||||
|
||||
# Add the new project in the same resource pools if the duplicated project belongs to any
|
||||
if pool_memberships:
|
||||
|
||||
Reference in new issue
Block a user