Sfoglia il codice sorgente

去除搜索工具中有问题的代码

tanghongbin 4 anni fa
parent
commit
131182a559
1 ha cambiato i file con 1 aggiunte e 16 eliminazioni
  1. 1 16
      controller/SearchToolController.py

+ 1 - 16
controller/SearchToolController.py

@@ -563,31 +563,17 @@ class SearchToolView(TemplateView):
         else:
             return response.json(0)
 
-
-    def do_deletemessage(self, request_dict, response):
-        print('delete')
-        messageid = request_dict.get('id', None)
-
-        try:
-            SearchToolMessage.objects.get(id=messageid).delete()
-
-        except Exception as e:
-            return response.json(404, repr(e))
-        else:
-            return response.json(0)
-
     def do_reset(self, request_dict, response, userID):
 
         return response.json(10,"数据已重置")
 
-
     def do_add_single(self, request_dict, response):
         word_class = request_dict.get('word_class', None)
         word_key = request_dict.get('word_key', None)
         word_array = request_dict.get('word_array', None)
         location_array = request_dict.get('location_array', None)
 
-        if (word_class and word_key and word_array and location_array):
+        if word_class and word_key and word_array and location_array:
             # SearchToolBlock
             # 检查是否已有该 name
             searchToolBlock_qs = SearchToolBlock.objects.filter(name=word_class)
@@ -605,7 +591,6 @@ class SearchToolView(TemplateView):
                     'updTime': addTime,
                 }
                 searchToolBlock_model = SearchToolBlock.objects.create(**dataDict)
-                searchToolBlock_model = searchToolBlock_qs[0]
                 dataDict.clear()
 
             # LangKeyModel,SearchToolKeyModel