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