fix: gen_commands bug

This commit is contained in:
caoqianming 2025-05-08 10:45:25 +08:00
parent a9f55eb61c
commit dae8d50d2c
1 changed files with 3 additions and 1 deletions

View File

@ -26,11 +26,13 @@ class LableMatViewSet(CustomListModelMixin, RetrieveModelMixin, CustomGenericVie
raise NotFound("标签模板不存在")
commands:list = lt.commands
try:
n_commands = []
for item in commands:
item = item.format(**tdata)
n_commands.append(item)
except Exception as e:
raise ParseError(f"标签解析错误-{str(e)}")
return commands
return n_commands
@action(methods=["post"], detail=False, serializer_class=TidSerializer)