Clean up theme compiler and thumbnail generation

Fix signup not clearning blanks - Thanks to Fennec
This commit is contained in:
Michał Gdula 2023-04-01 16:59:17 +00:00
parent 0e24004c0b
commit 95e5f3938f
7 changed files with 55 additions and 73 deletions

View file

View file

@ -33,6 +33,7 @@ def file(file_name):
r for resolution, 400x400 or thumb for thumbnail
"""
res = request.args.get('r', default=None, type=str) # Type of file (thumb, etc)
ext = request.args.get('e', default=None, type=str) # File extension
file_name = secure_filename(file_name) # Sanitize file name
# if no args are passed, return the raw file
@ -42,7 +43,7 @@ def file(file_name):
return send_from_directory(current_app.config['UPLOAD_FOLDER'], file_name)
thumb = generate_thumbnail(file_name, res)
thumb = generate_thumbnail(file_name, res, ext)
if not thumb:
abort(404)

View file

@ -23,7 +23,7 @@ def index():
db.Posts.image_colours,
db.Posts.created_at,
db.Posts.id).order_by(db.Posts.id.desc()).all()
if request.args.get('coffee') == 'please':
abort(418)