Ver código fonte

系统配置不允许删除

rambo 7 meses atrás
pai
commit
55a0bd1da2
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      python/api.py

+ 2 - 0
python/api.py

@@ -443,6 +443,8 @@ def get_device_configs(params: ModelGetDeviceConfigDetail):
     model = configModel.read(session, conditions={"id": action_id})
     if model == None:
         return {"code": 1, "msg": "数据不存在", "data": None}
+    if model.is_system == True:
+        return {"code": 1, "msg": "系统配置不允许删除", "data": None}
     configModel.delete(session, obj_id=action_id)
     return {"code": 0, "msg": "删除成功", "data": None}