Skip to content

Commit 754eb9e

Browse files
committed
fix answer url
1 parent 35478ab commit 754eb9e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

page_analyzer/app.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ def index():
2424
if request.method == 'POST':
2525
url_input = request.form.get('url')
2626
if not validators.url(url_input) or len(url_input) > 255:
27-
flash('Некорректный URL', 'error')
28-
# Можно оставить так: просто рендерим страницу с ошибкой
29-
return render_template('index.html'), 422
30-
# Валидный URL — делаем редирект
27+
# вызываем /urls явно или делаем редирект
28+
return redirect(url_for('urls', url=url_input))
3129
return redirect(url_for('urls', url=url_input))
3230
return render_template('index.html')
3331

0 commit comments

Comments
 (0)