Skip to content

Commit

Permalink
refactoring func add_url(app.py)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey-Barinov committed Apr 20, 2024
1 parent 5686536 commit 2d4410f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 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 8001
poetry run flask --app page_analyzer:app --debug run --port 8002

dev:
poetry run flask --app page_analyzer:app run
Expand Down
3 changes: 2 additions & 1 deletion page_analyzer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def add_url():

if error:
flash(f'{error}', 'danger')
return redirect(url_for('page_analyzer')), 422
message = get_flashed_messages(with_categories=True)
return render_template('index.html', message=message), 422

parsed_url = urlparse(new_url)
normal_url = f"{parsed_url.scheme}://{parsed_url.netloc}"
Expand Down

0 comments on commit 2d4410f

Please sign in to comment.