Implement flmt updating as content is updated

This commit is contained in:
Luxray5474 2020-08-24 21:34:45 -04:00
parent 04169c6942
commit 0c65406743

View file

@ -170,6 +170,12 @@ def update_post(ctx: rest.Context, params: Dict[str, str]) -> rest.Response:
if ctx.has_file("thumbnail"):
auth.verify_privilege(ctx.user, "posts:edit:thumbnail")
posts.update_post_thumbnail(post, ctx.get_file("thumbnail"))
if ctx.has_param("fileLastModifiedTime"):
posts.update_post_file_last_modified_time(
post, ctx.get_param_as_int("fileLastModifiedTime")
)
else:
post.file_last_modified_time = datetime.utcnow()
post.last_edit_time = datetime.utcnow()
ctx.session.flush()
snapshots.modify(post, ctx.user)