fix: fix the way to check article level

Alpha
吴宇涵 2023-03-21 12:29:44 +08:00
parent cabf6702a7
commit 1015704e23
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ def admin():
level = data.get("level", "5")
if content:
try: # check level
if not (0 < int(level) <= 5):
if level not in [str(x + 1) for x in range(5)]:
raise ValueError
except ValueError:
return "level must be between 1 and 5"