From 1015704e23969506bef99745d6e3d28c1cf4ec90 Mon Sep 17 00:00:00 2001 From: Awoodwhale Date: Tue, 21 Mar 2023 12:29:44 +0800 Subject: [PATCH] fix: fix the way to check article level --- app/admin_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin_service.py b/app/admin_service.py index a06c838..2ed9768 100644 --- a/app/admin_service.py +++ b/app/admin_service.py @@ -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"