We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35478ab commit 754eb9eCopy full SHA for 754eb9e
page_analyzer/app.py
@@ -24,10 +24,8 @@ def index():
24
if request.method == 'POST':
25
url_input = request.form.get('url')
26
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 — делаем редирект
+ # вызываем /urls явно или делаем редирект
+ return redirect(url_for('urls', url=url_input))
31
return redirect(url_for('urls', url=url_input))
32
return render_template('index.html')
33
0 commit comments