fix: gen_commands bug
This commit is contained in:
parent
a9f55eb61c
commit
dae8d50d2c
|
@ -26,11 +26,13 @@ class LableMatViewSet(CustomListModelMixin, RetrieveModelMixin, CustomGenericVie
|
||||||
raise NotFound("标签模板不存在")
|
raise NotFound("标签模板不存在")
|
||||||
commands:list = lt.commands
|
commands:list = lt.commands
|
||||||
try:
|
try:
|
||||||
|
n_commands = []
|
||||||
for item in commands:
|
for item in commands:
|
||||||
item = item.format(**tdata)
|
item = item.format(**tdata)
|
||||||
|
n_commands.append(item)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise ParseError(f"标签解析错误-{str(e)}")
|
raise ParseError(f"标签解析错误-{str(e)}")
|
||||||
return commands
|
return n_commands
|
||||||
|
|
||||||
|
|
||||||
@action(methods=["post"], detail=False, serializer_class=TidSerializer)
|
@action(methods=["post"], detail=False, serializer_class=TidSerializer)
|
||||||
|
|
Loading…
Reference in New Issue