mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Change project creator on import
Fixes #3017 Signed-off-by: Albert Stefanov <aastefanov@outlook.com>
This commit is contained in:
1 parent
68c929e224
commit
63d7fec8a7
2 files changed
+12
-2
No files matched your search
@@ -806,7 +806,12 @@ async def export_project(
|
||||
openapi_extra=binary_request_body(ZIP_MEDIA_TYPE),
|
||||
dependencies=[Depends(has_privilege("Project.Allocate"))],
|
||||
)
|
||||
async def import_project(project_id: UUID, request: Request, name: Optional[str] = None) -> schemas.Project:
|
||||
async def import_project(
|
||||
project_id: UUID,
|
||||
request: Request,
|
||||
name: Optional[str] = None,
|
||||
current_user: schemas.User = Depends(get_current_active_user),
|
||||
) -> schemas.Project:
|
||||
"""
|
||||
Import a project from a portable archive.
|
||||
|
||||
@@ -825,7 +830,7 @@ async def import_project(project_id: UUID, request: Request, name: Optional[str]
|
||||
async for chunk in request.stream():
|
||||
await f.write(chunk)
|
||||
with open(temp_project_path, "rb") as f:
|
||||
project = await import_controller_project(controller, str(project_id), f, name=name)
|
||||
project = await import_controller_project(controller, str(project_id), f, name=name, user=current_user.username)
|
||||
|
||||
log.info(f"Project '{project.name}' imported in {time.time() - begin:.4f} seconds")
|
||||
except OSError as e:
|
||||
|
||||
Reference in new issue
Block a user