mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix review issues: key_prefix length, count validation, WAL log, timeout comment, pointless temp var
This commit is contained in:
5 files changed
+10
-6
No files matched your search
@@ -65,6 +65,10 @@ def batch_allocate_udp_ports(project_id: UUID, body: dict) -> dict:
|
||||
"""
|
||||
|
||||
count = body.get("count", 1)
|
||||
try:
|
||||
count = max(1, min(int(count), 10000))
|
||||
except (ValueError, TypeError):
|
||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="count must be a positive integer")
|
||||
pm = ProjectManager.instance()
|
||||
project = pm.get_project(str(project_id))
|
||||
m = PortManager.instance()
|
||||
|
||||
Reference in new issue
Block a user