plugin name check

This commit is contained in:
qiaofeng1227 2023-06-30 10:41:09 +08:00
parent b6d3a0337d
commit 93356a04cc
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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