diff --git a/app/admin_service.py b/app/admin_service.py index 8632b43..30d622f 100644 --- a/app/admin_service.py +++ b/app/admin_service.py @@ -88,13 +88,13 @@ def article(): content = data.get("content", "") source = data.get("source", "") question = data.get("question", "") - level = data.get("level", "5") + level = data.get("level", "4") if content: try: # check level - if level not in [str(x + 1) for x in range(5)]: + if level not in ['1', '2', '3', '4']: raise ValueError except ValueError: - return "Level must be between 1 and 5" + return "Level must be between 1 and 4." add_article(content, source, level, question) _update_context() title = content.split('\n')[0]