Skip to content

Commit

Permalink
added 422 error
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey-Barinov committed Apr 20, 2024
1 parent 8aead10 commit 5686536
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions page_analyzer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 5686536

Please sign in to comment.