fix invalid Activity when sending image post

This commit is contained in:
rimu 2024-01-07 18:15:28 +13:00
parent 908ae14799
commit 4354d4259e

View file

@ -247,7 +247,8 @@ def save_post(form, post: Post):
file = File(file_path=final_place, file_name=new_filename + file_ext, alt_text=form.image_title.data,
width=img_width, height=img_height, thumbnail_width=thumbnail_width,
thumbnail_height=thumbnail_height, thumbnail_path=final_place_thumbnail)
thumbnail_height=thumbnail_height, thumbnail_path=final_place_thumbnail,
source_url=final_place.replace('app/static/', f"https://{current_app.config['SERVER_NAME']}/static/"))
post.image = file
db.session.add(file)