diff --git a/apps/cm/views.py b/apps/cm/views.py index e7a929de..214bbc26 100644 --- a/apps/cm/views.py +++ b/apps/cm/views.py @@ -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)