Upgrade allow adding image in ticket details page comment section

This commit is contained in:
2026-03-30 11:14:35 -04:00
parent 2beef382b7
commit bf29ccb287
13 changed files with 419 additions and 26 deletions
+9 -3
View File
@@ -348,9 +348,15 @@ def download_attachment(att_id):
f'user_id={current_user.id}'
)
abort(403)
upload_dir = current_app.config['UPLOAD_FOLDER']
return send_from_directory(upload_dir, att.stored_name, as_attachment=True,
download_name=att.filename)
upload_dir = current_app.config['UPLOAD_FOLDER']
is_image = (att.mime_type or '').startswith('image/')
return send_from_directory(
upload_dir,
att.stored_name,
as_attachment = not is_image, # images render inline; other files force-download
download_name = att.filename,
mimetype = att.mime_type or None,
)
# ─── Notifications ────────────────────────────────────────────────────────────