mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51: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
@@ -51,6 +51,7 @@ async def import_project(
|
||||
auto_start=False,
|
||||
auto_open=False,
|
||||
auto_close=True,
|
||||
user=None,
|
||||
):
|
||||
"""
|
||||
Import a project contain in a zip file
|
||||
@@ -65,6 +66,7 @@ async def import_project(
|
||||
:param reset_mac_addresses: Reset MAC addresses for each node
|
||||
:param keep_compute_ids: keep compute IDs unchanged
|
||||
:param project_name: Original project name when restoring a snapshot
|
||||
:param user: User importing the project
|
||||
|
||||
:returns: Project
|
||||
"""
|
||||
@@ -120,6 +122,9 @@ async def import_project(
|
||||
topology["auto_open"] = auto_open
|
||||
topology["auto_close"] = auto_close
|
||||
|
||||
if user:
|
||||
topology["created_by"] = user
|
||||
|
||||
if not restoring_snapshot:
|
||||
# Do not re-generate IDs if we are restoring a snapshot because they should be the same in a project
|
||||
regenerate_topology_ids(topology, path, reset_mac_addresses=reset_mac_addresses)
|
||||
|
||||
Reference in new issue
Block a user