Просмотр исходного кода

```
refactor(run_main): 移除模板可调用性检查的验证逻辑

移除了两个位置的模板可调用性验证代码:
1. 第480行附近:注释掉了 template_type == 0 时对 temp_class[temp_name] 的可调用性检查
2. 第1085行附近:注释掉了详情页模板的可调用性检查

这些验证逻辑被暂时禁用,可能为了调试或功能调整目的。
```

rambo 4 недель назад
Родитель
Сommit
be7ae49715
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      python/service/run_main.py

+ 5 - 5
python/service/run_main.py

@@ -480,9 +480,9 @@ class RunMain:
             class_path = class_obj.get("cls")
             class_path = class_obj.get("cls")
             template_type = class_obj.get("template_type")
             template_type = class_obj.get("template_type")
             # 确保 temp_class[temp_name] 是可调用的
             # 确保 temp_class[temp_name] 是可调用的
-            if template_type ==0:
-                if not callable(temp_class[temp_name]):
-                    raise UnicornException(f"模板 {temp_name} 不是有效的可调用对象")
+            # if template_type ==0:
+                # if not callable(temp_class[temp_name]):
+                #     raise UnicornException(f"模板 {temp_name} 不是有效的可调用对象")
             try:
             try:
                 if template_type ==0:
                 if template_type ==0:
                     need_view_list = class_path.need_view
                     need_view_list = class_path.need_view
@@ -1085,8 +1085,8 @@ class RunMain:
         if temp_name not in temp_class or temp_class[temp_name] is None:
         if temp_name not in temp_class or temp_class[temp_name] is None:
                 raise UnicornException(f"详情页模板 {temp_name} 未正确加载")
                 raise UnicornException(f"详情页模板 {temp_name} 未正确加载")
         if template_type == 0:
         if template_type == 0:
-            if not callable(class_path):
-                raise UnicornException(f"详情页模板 {temp_name} 不是有效的可调用对象")
+            # if not callable(class_path):
+            #     raise UnicornException(f"详情页模板 {temp_name} 不是有效的可调用对象")
             try:
             try:
                 # # 处理图片详情图生成
                 # # 处理图片详情图生成
                 class_path(
                 class_path(