From 5686536f707f03155d59905b7a67e71ad9fbfd19 Mon Sep 17 00:00:00 2001 From: Andrey-Barinov Date: Sat, 20 Apr 2024 16:47:43 +0300 Subject: [PATCH] added 422 error --- Makefile | 2 +- page_analyzer/app.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5fea5c9..49673de 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ install: poetry install debug-mode: - poetry run flask --app page_analyzer:app --debug run --port 8000 + poetry run flask --app page_analyzer:app --debug run --port 8001 dev: poetry run flask --app page_analyzer:app run diff --git a/page_analyzer/app.py b/page_analyzer/app.py index b51d01b..e28cef6 100644 --- a/page_analyzer/app.py +++ b/page_analyzer/app.py @@ -43,7 +43,7 @@ def add_url(): if error: flash(f'{error}', 'danger') - return redirect(url_for('page_analyzer')) + return redirect(url_for('page_analyzer')), 422 parsed_url = urlparse(new_url) normal_url = f"{parsed_url.scheme}://{parsed_url.netloc}" @@ -97,7 +97,7 @@ def add_check(id): flash('Произошла ошибка при проверке', 'danger') - return redirect(url_for('show_url', id=id)), 422 + return redirect(url_for('show_url', id=id)) status_code = response.status_code