max length of 300 chars of alt text #78

This commit is contained in:
rimu 2024-04-03 20:33:49 +13:00
parent 15f834c08e
commit 7dd5c61bc7

View file

@ -240,7 +240,7 @@ def save_post(form, post: Post):
if file_extension.lower() in allowed_extensions and not filename.startswith('/'):
file = url_to_thumbnail_file(filename)
if file:
file.alt_text = opengraph.get('og:title')
file.alt_text = shorten_string(opengraph.get('og:title'), 295)
post.image = file
db.session.add(file)