changes(backend): return 404 if paste not exist

This commit is contained in:
Ada 2023-09-26 13:46:04 +02:00
parent 4b19713c06
commit df2837d3ff

View file

@ -5,7 +5,7 @@ from flask import (
redirect,
render_template,
request,
url_for,
url_for, abort,
)
from werkzeug import Response
@ -60,5 +60,9 @@ def get_content(path: str) -> str:
:return: Paste content.
"""
db = connect_redis()
flash(db.get(path))
return render_template("content.html.j2")
data = db.get(path)
if check_content_exist(path):
flash(data)
return render_template("content.html.j2")
else:
abort(404)