mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 15:21:13 +02:00
Fix config option to disable built-in templates.
This commit is contained in:
1 parent
d8b928f1c1
commit
410f062721
3 files changed
+18
-2
No files matched your search
@@ -23,6 +23,7 @@ from fastapi.encoders import jsonable_encoder
|
||||
from typing import List
|
||||
|
||||
from gns3server import schemas
|
||||
from gns3server.config import Config
|
||||
import gns3server.db.models as models
|
||||
from gns3server.db.repositories.templates import TemplatesRepository
|
||||
from gns3server.controller.controller_error import (
|
||||
@@ -174,8 +175,9 @@ class TemplatesService:
|
||||
db_templates = await self._templates_repo.get_templates()
|
||||
for db_template in db_templates:
|
||||
templates.append(db_template.asjson())
|
||||
for builtin_template in BUILTIN_TEMPLATES:
|
||||
templates.append(jsonable_encoder(builtin_template))
|
||||
if Config.instance().settings.Server.enable_builtin_templates:
|
||||
for builtin_template in BUILTIN_TEMPLATES:
|
||||
templates.append(jsonable_encoder(builtin_template))
|
||||
return templates
|
||||
|
||||
async def _find_image(self, image_path: str):
|
||||
|
||||
Reference in new issue
Block a user