Skip to content

Commit c12755e

Browse files
committed
fix answer url
1 parent 7802ded commit c12755e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

page_analyzer/app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ def index():
2525
url_input = request.form.get('url')
2626
# Проверка валидности
2727
if not validators.url(url_input) or len(url_input) > 255:
28-
# Вместо рендера ошибки — редирект на /urls с этим же URL
28+
# Редирект на /urls с этим же URL
29+
return redirect(url_for('urls', url=url_input))
30+
else:
2931
return redirect(url_for('urls', url=url_input))
30-
return redirect(url_for('urls', url=url_input))
3132
return render_template('index.html')
3233

3334
@app.route('/urls', methods=['GET', 'POST'])

0 commit comments

Comments
 (0)