Ver Fonte

plugin name check

qiaofeng1227 há 2 anos atrás
pai
commit
93356a04cc
2 ficheiros alterados com 4 adições e 2 exclusões
  1. 1 1
      appmanage/Dockerfile
  2. 3 1
      appmanage/api/service/db.py

+ 1 - 1
appmanage/Dockerfile

@@ -10,7 +10,7 @@ COPY static ./static
 COPY requirements.txt main.py database.sqlite  ./
 RUN apt update
 
-# Install supervisords
+# Install supervisord
 RUN apt install -y supervisor
 COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
 COPY config/cmd.sh /cmd.sh

+ 3 - 1
appmanage/api/service/db.py

@@ -19,7 +19,9 @@ def AppUpdateUser(user_name, password):
     conn.close()
 
 def AppSearchUsers(user_type):
-    if user_type != "nginx" or user_type != "portainer":
+    if user_type == None or user_type == "undefine":
+      raise CommandException(const.ERROR_CLIENT_PARAM_BLANK, "This plugin is blank!", "This plugin is blank!")
+    if user_type != "nginx" and user_type != "portainer":
       raise CommandException(const.ERROR_CLIENT_PARAM_NOTEXIST, "This plugin doesn't exist!", "This plugin doesn't exist!")
     conn = sqlite3.connect('/usr/src/app/database.sqlite')
     conn.row_factory = dict_factory